• Resolved sarahtopfstaedt

    (@sarahtopfstaedt)


    Hi there,

    I want to exclude some post types from access restriction without to go into any single post to set this up (sorry, not possible for more than 2000 posts).

    I tried this:

    add_filter( 'um_custom_restriction', 'exclude_custom_post_types_from_um_restriction', 10, 2 );

    function exclude_custom_post_types_from_um_restriction( $custom_restriction, $restriction ) {
    if ( is_singular() ) {
    $post_type = get_post_type();

    $excluded_post_types = array( 'glossary', 'snippet', 'index_tag' );

    if ( in_array( $post_type, $excluded_post_types, true ) ) {
    return false; // keine UM-Beschränkung
    }
    }

    return $custom_restriction;
    }

    But this isn`t working. Any other ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @sarahtopfstaedt

    You could disable post types from restrictions on the Ultimate Member – Settings – Access page.

    Regards.

    Thread Starter sarahtopfstaedt

    (@sarahtopfstaedt)

    I tried but even than, for example, posts or faq are NOT public because I have set “website is only available for logged in users”. So, the conclusion is that I have to set MANUALLY for EVERY single post/faq that this one is public. Sorry, but that’s not intuitive or possible for larger websites.

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @sarahtopfstaedt

    Try to do this with categories restriction settings for this post types.

    Regards.

    Thread Starter sarahtopfstaedt

    (@sarahtopfstaedt)

    Sorry, but this all seems really clumsy. I used another plugin to do this much much simpler with a few clicks.

    Maybe it’s something that you can fix in the future. To be honest: The function is not really well thought out for users with more than 20 posts, for example. Sorry…

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @sarahtopfstaedt

    We plan to change this in feature, thank you for your feedback.

    Regards.

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

The topic ‘Exclude post types from restriction’ is closed to new replies.