Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Last active June 16, 2020 12:18
Show Gist options
  • Save cryptexvinci/bae31b1f683639a96c832c12c535f8ad to your computer and use it in GitHub Desktop.
Save cryptexvinci/bae31b1f683639a96c832c12c535f8ad to your computer and use it in GitHub Desktop.
Ultimate Member sample user query
<?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
}
}
?>
@Cbookwap
Copy link

Thanks. Please, where do i=I paste this snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment