-
-
Save ideadude/59e4dffbfae2216cff2172ef140efc91 to your computer and use it in GitHub Desktop.
Add the PMPro meta box to a CPT. Add this to your plugin/etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add the PMPro meta box to a CPT | |
*/ | |
function my_add_pmpro_meta_box_to_cpts() { | |
// Duplicate this row for each CPT. This one adds the meta boxes to 'product' CPTs. | |
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'product', 'side' ); | |
} | |
add_action( 'admin_menu', 'my_add_pmpro_meta_box_to_cpts', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Add PMPro’s “Require Membership” Meta Box to a Custom Post Type" at Paid Memberships Pro here: https://www.paidmembershipspro.com/add-pmpro-membership-level-meta-box-to-a-custom-post-type/