<?php

global $post;
$set_arr = ihc_get_default_pages_il(true);
if ($set_arr && count($set_arr) && in_array($post->ID, $set_arr)) {
    //if current page is set to be default page go back
    echo ihc_meta_box_page_type_message();
} else {
    $unset_arr = ihc_get_default_pages_il();
    //getting the unset pages
    if ($unset_arr) {
        $unset_arr = ihc_get_default_pages_il();
        if ($unset_arr) {
            //the select
            ?>
			<div class="ihc-padding">
			<div class="ihc-bold"><?php 
            _e('Set the Page as:', 'ihc');
            ?>
</div>
			<select class="ihc-fullwidth ihc-select" name="ihc_set_page_as_default_something">
				<option value="-1">...</option>
				<?php 
            foreach ($unset_arr as $name => $label) {
                ?>
							<option value="<?php 
                echo $name;
                ?>
"><?php 
                echo $label;
                ?>
Exemple #2
0
function ihc_set_default_pages_meta_box()
{
    global $post;
    $set_arr = ihc_get_default_pages_il(true);
    if ($set_arr && count($set_arr) && in_array($post->ID, $set_arr) || ihc_get_default_pages_il()) {
        add_meta_box('ihc_default_pages_content', 'Membership Pro - Page Type', 'ihc_meta_box_default_pages_html', 'page', 'side', 'high');
    }
}