Skip to content

Instantly share code, notes, and snippets.

@seventhqueen
Forked from strangerstudios/pmpro-cpt.php
Last active January 15, 2018 16:06
Show Gist options
  • Save seventhqueen/f9e9a5f5fb3876bafe225e4ffbeec8d9 to your computer and use it in GitHub Desktop.
Save seventhqueen/f9e9a5f5fb3876bafe225e4ffbeec8d9 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_sensei_course_meta_wrapper()
{
//duplicate this row for each CPT
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'course', 'side');
}
function pmpro_cpt_init()
{
if (is_admin())
{
add_action('admin_menu', 'my_sensei_course_meta_wrapper');
}
}
add_action("init", "pmpro_cpt_init", 20);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment