Last active
June 16, 2020 12:18
-
-
Save cryptexvinci/bae31b1f683639a96c832c12c535f8ad to your computer and use it in GitHub Desktop.
Ultimate Member sample user query
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
<?php | |
/* | |
Code snippet of Plugin Ultimate Member | |
URL: https://wordpress.org/plugins/ultimate-member/ | |
*/ | |
// WP_User_Query arguments | |
$args = array( | |
'fields' => 'ID', | |
'order' => 'ASC', | |
'orderby' => 'id', | |
); | |
// The User Query | |
$user_query = new WP_User_Query( $args ); | |
$users = $user_query->get_results(); | |
// The User Loop | |
if ( ! empty( $users ) ) { | |
foreach ( $users as $user_id ) { | |
um_fetch_user( $user_id ); | |
?> | |
<div class="um-member-list "> | |
<div class="um-member-list-container"> | |
<h4 class="entry-title"> | |
<a title="<?php echo um_user('display_name')?>" href="<?php echo um_user_profile_url()?>"> | |
<?php echo um_user( "display_name" );?> | |
</a> | |
</h4> | |
</div> | |
</div> | |
<?php | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. Please, where do i=I paste this snippet?