Exemple #1
0
function hocwp_theme_post_submitbox_misc_actions()
{
    global $post;
    if (!hocwp_object_valid($post)) {
        return;
    }
    $post_type = $post->post_type;
    $type_object = get_post_type_object($post_type);
    if ((bool) $type_object->public) {
        $post_types = hocwp_post_type_no_featured_field();
        if (!in_array($post_type, $post_types)) {
            $key = 'featured';
            $value = get_post_meta($post->ID, $key, true);
            $args = array('id' => 'hocwp_featured_post', 'name' => $key, 'value' => $value, 'label' => __('Featured?', 'hocwp-theme'));
            hocwp_field_publish_box('hocwp_field_input_checkbox', $args);
        }
    }
    do_action('hocwp_' . $post_type . '_publish_box_field', $post);
    do_action('hocwp_publish_box_field', $post_type, $post);
}
function hocwp_theme_post_submitbox_misc_active()
{
    global $post;
    if (!hocwp_object_valid($post)) {
        return;
    }
    $post_type = $post->post_type;
    //$type_object = get_post_type_object($post_type);
    $use_active = false;
    if ('hocwp_sidebar' == $post_type || 'hocwp_ads' == $post_type || 'license' == $post_type) {
        $use_active = true;
    }
    if ('hocwp_subscriber' == $post_type) {
        $use_active = true;
    }
    if ($use_active) {
        $key = 'active';
        $value = get_post_meta($post->ID, $key, true);
        $args = array('id' => 'hocwp_post_active', 'name' => $key, 'value' => $value, 'label' => __('Active?', 'hocwp-theme'));
        hocwp_field_publish_box('hocwp_field_input_checkbox', $args);
    }
}