Page 1 of 1

block all by default - list exceptions

PostPosted: May 11th, 2011, 11:51 pm
by arthomas
Hello

Is it possible to block all posts, and just list the few exceptions?
I only want to allow a few posts, all other should be protected, it would be much easier to just list the 5 posts that are allowed, instead of having to list or tag all the protected.

In other words, instead of the default being everything allowed and having to list what I want blocked, is it possible to do it in just the opposite way?

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 12:27 am
by Cristián Lávaque
Not that I know...

Tags is probably what I'd use, since you can tag posts in bulk... Same for categories.

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 12:42 am
by arthomas
interesting how such simple stuff (see my previous posts for 2 more) are not implemented in an otherwise such well developed and mature plugin.
just saying... really not complaining.

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 1:07 am
by Cristián Lávaque
Well, it's quite advanced, but it's still got a way to go. It's the great feedback from guys like you that helps push the plugin forward. We're also discussing several things that will be coming out in future releases. So, yeah, pretty mature, but still more to come. Thanks for the great feedback! :)

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 1:55 am
by arthomas
I am glad you are listening to the feedback.
great work guys!

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 4:55 pm
by arthomas
Cristián Lávaque wrote:Not that I know...

Tags is probably what I'd use, since you can tag posts in bulk... Same for categories.


how would one tag 1000+ posts?

Re: block all by default - list exceptions

PostPosted: May 12th, 2011, 6:41 pm
by Cristián Lávaque
Maybe a tagging plugin will let you do that easily. Checked a few and this one seems to do what you need https://wordpress.org/extend/plugins/we ... ng-system/

Let me know if it helps. :)

Re: block all by default - list exceptions

PostPosted: May 13th, 2011, 4:39 am
by Jason Caldwell
Thanks for the great question.
~ and thanks for the heads up Cristián.

Yes, this is possible.
Until we have this integrated into the UI panel for s2Member,
you can use this Filter/hack to accomplish what you need to.

1. Protect "all" Pages, or "all" Posts using s2Member's UI panel in the Dashboard.
2. Now, create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter 
("ws_plugin__s2member_check_post_level_access_excluded", "my_post_page_exclusions");
add_filter ("ws_plugin__s2member_check_page_level_access_excluded", "my_post_page_exclusions");
function my_post_page_exclusions ($excluded = false)
    {
        $excluded_posts = array (3345, 49343); /* Comma-delimited Post IDs to exclude. */
        $excluded_pages = array (3004, 39494); /* Comma-delimited Page IDs to exclude. */
        /**/
        if (($excluded_posts && is_single ($excluded_posts)) || ($excluded_pages && is_page ($excluded_pages)))
            return ($excluded = true);
    }
?>