-
-
Save michaelbeil/844c50437b8a93064c0ab92ef4db69d7 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 | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_add_pmpro_meta_box_to_cpts() { | |
// Duplicate this row for each CPT. This one adds the meta boxes to 'advert' CPTs. | |
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'advert', '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