Created
August 15, 2015 03:31
-
-
Save kylephillips/82b9fa6965cc67433275 to your computer and use it in GitHub Desktop.
Example of using the User List filter in the Favorites WordPress plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('simplefavorites_user_list', 'filter_favorites_user_list', 10, 3); | |
function filter_favorites_user_list($output, $users, $anonymous_count) | |
{ | |
$output = '<ul>'; | |
foreach($users as $user){ | |
$output .= '<li><a href="' . site_url() . '/members/' . $user->user_login . '">' . $user->display_name . '</a></li>'; | |
} | |
$output .= '</ul>'; | |
$output .= '(+' . $anonymous_count . ' Anonymous Users)'; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment