Title: shortcode display directory based email
Last modified: November 30, 2022

---

# shortcode display directory based email

 *  Resolved [stephanefromain](https://wordpress.org/support/users/stephanefromain/)
 * (@stephanefromain)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/shortcode-display-directory-based-email/)
 * Hello,
    I am using a shortcode to display the member directory in the account
   page. [ultimatemember form_id=”6839″]
 * The user can create several accounts with the same email.
 * I want the user to see only the IDs created with his email in the directory.
 * I added in snippets the code below but another account is displayed anyway.
 * I saw that there is also
    <?php add_action(‘um_members_directory_display’, ‘my_members_directory_display’,
   10, 1); function my_members_directory_display( $args ) { // your code here } ?
   > But I don’t know what code to put?
 * CODE SNIPPETS
    /** * Prevent members from being able to see themselves in the
   member directory. * Add this code to the file functions.php in the active theme
   directory. */
 * function um_pre_users_query_name( $directory ) {
    if ( is_user_logged_in() ) {
   $directory->where_clauses[] = ‘u.ID != ‘ . get_current_user_id(); } } add_action(‘
   um_pre_users_query’, ‘um_pre_users_query_notme’, 20 );
 * function um_prepare_user_query_args_name( $query_args ) {
    if ( is_user_logged_in()){
   $query_args[‘exclude’] = get_current_user_id(); } return $query_args; } add_filter(‘
   um_prepare_user_query_args’, ‘um_prepare_user_query_args_notme’, 20 );

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * (@andrewshu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/shortcode-display-directory-based-email/#post-16344775)
 * Hello [@stephanefromain](https://wordpress.org/support/users/stephanefromain/)
 * Sorry but I can’t understand your question. Could you describe more details?
 * Thank you.
 *  Plugin Support [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * (@andrewshu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/shortcode-display-directory-based-email/#post-16357040)
 * Hi [@stephanefromain](https://wordpress.org/support/users/stephanefromain/)
 * This thread has been inactive for a while so we’re going to go ahead and mark
   it Resolved.
 * Please feel free to re-open this thread if any other questions come up and we’d
   be happy to help. 🙂
 * Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘shortcode display directory based email’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [andrewshu](https://wordpress.org/support/users/andrewshu/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/shortcode-display-directory-based-email/#post-16357040)
 * Status: resolved