Paid Memberships Pro
[resolved] Custom Post Types & Taxonomies (4 posts)

  1. codescribblr
    Posted 3 years ago #

    Can I use custom post types and custom taxonomies (instead of posts and categories) to allow or restrict members access?

    When you create a new membership level, you can choose a category to automatically give access to the new level. But there's no option to allow for custom post types or taxonomies there. Can this be done?


  2. Jason Coleman
    Plugin Author

    Posted 3 years ago #

    Some info that may help you.

    To enable the "require membership" box for a CPT (which will let you lock down individual CPTs): http://www.paidmembershipspro.com/2012/07/add-pmpro-membership-level-meta-box-to-a-custom-post-type/

    To lock down a custom taxonomy, you can write some custom code to hook into the pmpro_has_membership_access_filter or pmpro_has_membership_access_filter_{posttype} hook.

    Here is an example doing something else, but might help:

    If you sign up for support at http://www.paidmembershipspro.com, I can write up some more specific code for you.

    Hope this helps.

  3. wtoalabi
    Posted 2 years ago #

    Yes Jon!
    I just found our the solution!
    All you need to do is just locate:

    Search inside for

    add_meta_box('pmpro_page_meta', _x('Require Membership', 'metabox heading', 'pmpro'), 'pmpro_page_meta', 'page', 'side');

    Now just change the 'page' to whatever is the code-name of your custom-type.

    For example, try to create a new custom type and if your address looks like this:


    Then, "myportfolios" is your custom-type.

    Just replace the word "page" in the metabox above to myportfolios

    Thats all!

  4. Slocum Themes
    Posted 2 years ago #

    Hi Jon,

    You have found a solution, but I would advise against modifying the plugin files as an update to the plugin will erase any changes you may have made. Please refer to the post Jason referenced above for adding a meta box to your custom post type. You'll want to keep your modifications to PMPro in your current theme, or a plugin to prevent over-writes.

    I'm going to resolve this thread. If you have any other questions, please feel free to open a new one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Paid Memberships Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic