Any way to protect all posts content under a custom post type in WP?

Discussion in 'Integration' started by trbrack, Aug 27, 2013.

  1. trbrack

    trbrack New Member

    Joined:
    Jul 18, 2013
    Messages:
    3
    We are using amember pro paid version 4.2.19. In our setup we've got a large number of posts under a custom post type of "portfolio" that we would like to have automatically protected with the same settings, showing post content only to a user with a subscription, otherwise leading them to the join page. I can see how to do this on an individual post level from within the add/edit post page, but it seems a pain to have to set all posts manually like this. I can also see in the amember plugin there's a way to protect the whole blog, but this also protects the main index page and, in fact, ALL pages, which will not work.

    I searched the forums and found nothing about this. Apologies if I've overlooked it.

    Thanks for any help!
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,435
    How about putting them in a category, and protecting the category.

    David
  3. trbrack

    trbrack New Member

    Joined:
    Jul 18, 2013
    Messages:
    3
    Thanks for the reply. Unfortunately that would require a large amount of work and we've made a clot of customizations to the site that would need to be customized further and we frankly don't have the budget.

    I have a custom post type of portfolio with a couple of categories in there that hold all of the content now. I've compartmentalized the content in this way to make things easier for the client and feel that this would provide confusion and user error in terms of correctly categorizing her content if I change how we are doing things.

    It seems there's got to be a way to take the code that adds the bulk protection checkboxes in the main post/categories pages and customize it a bit to add the checkboxes to a custom post type/category. I can protect the posts individually that are within the custom post type but this isn't going to work as the client is adding her content herself and I know would forget to protect some content.

    Are there amember functions that could be used to protect content in functions.php? Something like:
    if ( 'portfolio' == get_post_type() ) {
    amember_protect();
    }

    Thanks!
  4. trbrack

    trbrack New Member

    Joined:
    Jul 18, 2013
    Messages:
    3
    In looking through past forum posts, it seems that this is possible under v3 but not v4? If that is the case, why would you move backwards in terms of a feature like this? It is extremely common to use custom post types and taxonomies in Wordpress now.
  5. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,435
    You can do a bulk protection of posts/pages too.
    If theirs something specific about them, do a search, then checkbox all, then on the bottom of the page- you can select amember protection.

    David

Share This Page