Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add the PMPro meta box to a CPT. Add this to your plugin/etc.
<?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 );
@laurenhagan0306

This comment has been minimized.

Copy link

@laurenhagan0306 laurenhagan0306 commented Apr 16, 2021

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment