function pmproap_post_meta_wrapper()
{
    /**
     * @since v0.7 - Supports Custom Post Type (CPT) posts as add-on package/posts
     */
    $post_types = apply_filters('pmproap_supported_post_types', array('page', 'post'));
    // get extra post types from PMPro CPT, if available
    if (function_exists('pmprocpt_getCPTs')) {
        $post_types = array_merge($post_types, pmprocpt_getCPTs());
    }
    foreach ($post_types as $type) {
        add_meta_box('pmproap_post_meta', __('PMPro Addon Package Settings', 'pmproap'), 'pmproap_post_meta', $type, 'normal');
    }
}
Example #2
0
function pmprocpt_options_page()
{
    global $pmprocpt_cpts, $msg, $msgt;
    //get options
    $options = get_option("pmprocpt_options");
    $pmprocpt_cpts = get_post_types('', 'names');
    $cpt_selections = pmprocpt_getCPTs();
    ?>
<div class="wrap">
	<div id="icon-options-general" class="icon32"><br></div>
	<h2>Paid Memberships Pro - Custom Post Type Membership Access</h2>		
	
	<?php 
    if (!empty($msg)) {
        ?>
		<div class="message <?php 
        echo $msgt;
        ?>
"><p><?php 
        echo $msg;
        ?>
</p></div>
	<?php 
    }
    ?>
	
	<form action="options.php" method="post">
		
		<p>This plugin will add the PMPro "Require Membership" meta box to all CPTs selected. If a non-member visits that single CPT (either a logged out visitor or a logged in user without membership access) they will be redirected to the selected page.</p>
		<hr />
		
		<?php 
    settings_fields('pmprocpt_options');
    ?>
		<?php 
    do_settings_sections('pmprocpt_options');
    ?>

		<p><br /></p>
						
		<div class="bottom-buttons">
			<input type="hidden" name="pmprocpt_options[set]" value="1" />
			<input type="submit" name="submit" class="button-primary" value="<?php 
    esc_attr_e('Save Settings');
    ?>
">
		</div>
		<p><br /></p>
		<hr />
		<p><strong>Notes:</strong></p>
		<p>This redirection will also apply to a search engine indexing your site.</p>
		<p>Setting membership access restrictions for a single CPT will not necessarily hide it from archives, search, or other custom template built into your theme.</p>
	</form>
</div>
<?php 
}