Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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