DocumentationOnline documentation for Ajax Load More
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// functions.php function my_alm_users_query($args, $id){ // $id = Current post/page ID where the ALM shortcode is found // ALM Shortcode // [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); |
Note: This filter uses the same principles as the core alm_query_args filter.