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_column_head_featured($columns) { global $post_type; $type_object = get_post_type_object($post_type); if (hocwp_object_valid($type_object) && (bool) $type_object->public) { $exclude_types = hocwp_post_type_no_featured_field(); if (!in_array($post_type, $exclude_types)) { $columns['featured'] = __('Featured', 'hocwp-theme'); } } return $columns; }