Commit 851750ff authored by John James Jacoby's avatar John James Jacoby
Browse files

JIT filter for users.

parent ed8f789a
......@@ -36,11 +36,24 @@ function wp_user_directory_page( $view = 'all' ) {
// Query for users
$users = new WP_User_Query( $r );
// Bail if no users (how did this happen?)
if ( empty( $users->results ) ) {
return;
}
// JIT filter of users
$results = apply_filters( 'wp_user_directory_users', $users->results, $users, $r );
// Bail if users got noop'ed
if ( empty( $results ) ) {
return;
}
// Top template
wp_user_directory_get_template_part( 'top' );
// Loop through users
foreach ( $users->results as $user ) {
foreach ( $results as $user ) {
// Set the global for the template loop
$GLOBALS['wp_displayed_user'] = $user;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment