Created
November 20, 2013 17:42
-
-
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.
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_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); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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