• Resolved eroussel

    (@eroussel)


    Hello everyone. I am working on an internal platform for my company and I am looking to use Ultimate Member for the Directory but as well for the Access Restriction. I have an issue concerning the Post Restriction. When an unauthorized person enter the URL of the limited access post, he can see the Featured Image and the Excerpt. Does anyone know how I can hide both of it ? Make a redirection when the logged in user hasn’t got the correct role to see the Post.

    Thanks a lot for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @eroussel

    You can try this code to hide the post thumbnails for non-logged in users:

    add_filter("um_restrict_post_thumbnail","um_custom_restrict_post_thumbnail", 10, 3 );
    function um_custom_restrict_post_thumbnail( $has_thumbnail, $post, $thumbnail_id ){
      
      if( ! is_user_logged_in() ){ 
        return false;
      }
      return $has_thumbnail;
    }

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    You can also try restricting all pages with exception to specific pages in WP Admin > Ultimate Member > Settings > Access.

    Regards,

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

The topic ‘Featured Image and Excerpt Restriction’ is closed to new replies.