Skip to content

Instantly share code, notes, and snippets.

@kylephillips
Created August 15, 2015 03:31
Show Gist options
  • Save kylephillips/82b9fa6965cc67433275 to your computer and use it in GitHub Desktop.
Save kylephillips/82b9fa6965cc67433275 to your computer and use it in GitHub Desktop.
Example of using the User List filter in the Favorites WordPress plugin
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