• Hi there,

    First: Great plugin! But I have a question about the exceptions URLs for restrict content: Is it possible to set up a whole bunch of pages as an exception, e.g. I have a parent page “Hilfe” and I want every children page from this parent to be accessible for everyone. Every other pages are restricted.

    Thanks a lot!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Yurii

    (@yuriinalivaiko)

    Hi @sarahtopfstaedt

    You can add the pages you want to excluded URLs in the content restriction settings (Ultimate Member > Settings > Access > Restriction Content)

    More detailed information about content restrictions settings can be found here – https://docs.ultimatemember.com/article/1736-content-restriction

    Regards.

    Thread Starter sarahtopfstaedt

    (@sarahtopfstaedt)

    Unfortunately, add every single page doesn´t work for us: We have to exclude around 100 single pages, so that`s not possible to do manually in our daily schedule.

    missveronica

    (@missveronicatv)

    @sarahtopfstaedt

    You can try this code snippet, which temporarily adds the current URL
    to the “Exclude the following URLs” list if /hilfe/ is present in the URL.

    The UM settings will not be updated and current subpages may be removed.

    add_filter( 'um_get_option_filter__access_exclude_uris', 'add_access_exclude_uris_parent_childs', 10, 1 );
    function add_access_exclude_uris_parent_childs( $options ) {
        $parent_page = '/hilfe/';
        $current_url = UM()->permalinks()->get_current_url( UM()->is_permalinks );
        if ( str_contains( $current_url, $parent_page )) {
            $options = array_merge( $options, array( $current_url ));
        }
        return $options;
    }

    You install the code snippet by adding it
    to your active theme’s functions.php file
    or use the “Code Snippets” Plugin

    https://ww.wp.xz.cn/plugins/code-snippets/

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hi @sarahtopfstaedt

    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

    missveronica

    (@missveronicatv)

    @sarahtopfstaedt

    I have added an UM new feature request for the UM developers about your issue.

    https://github.com/ultimatemember/ultimatemember/issues/1702

    Thread Starter sarahtopfstaedt

    (@sarahtopfstaedt)

    Thanks a lot!

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

The topic ‘Restrict content exceptions custom URLs’ is closed to new replies.