Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created November 20, 2013 17:42
Show Gist options
  • Save strangerstudios/7567620 to your computer and use it in GitHub Desktop.
Save strangerstudios/7567620 to your computer and use it in GitHub Desktop.
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_page_meta_wrapper()
{
//duplicate this row for each CPT
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'product', 'side');
}
function pmpro_cpt_init()
{
if (is_admin())
{
add_action('admin_menu', 'my_page_meta_wrapper');
}
}
add_action("init", "pmpro_cpt_init", 20);
?>
@ideadude
Copy link

I can no longer edit gists made by the strangerstudios account. Here is a forked version that is simpler and actually works with the latest versions of WordPress and Paid Memberships Pro: https://gist.github.com/ideadude/59e4dffbfae2216cff2172ef140efc91

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