Add-ons /

Users

Developer documentation for the Ajax Load More Users add-on.


Filter Hooks

The following filter hooks are available when using this add-on:

alm_users_query_args_{id}

The alm_users_query_args_{id}() filter can be used to modify WP_User_Query arguments by a specific Ajax Load More instance ID.

The following snippet would be pasted in your theme’s functions.php file.

functions.php
function my_alm_users_query($args, $id){	 
	// $id = Current post/page ID where the ALM shortcode is found
	
	// [ajax_load_more id="user_listing" users="true" users_role="Administrator"]
	// 'user_listing' is the value of the 'id' parameter in the shortcode.
	
	$args['order'] = 'ASC'; 
	return $args;
}
add_filter( 'alm_users_query_args_user_listing', 'my_alm_users_query', 10, 2 );
PHP

Note: This filter uses the same principles as the core alm_query_args filter.


« Back to Add-ons