modify post submit box (add wp_dropdown_category with custom taxonomy)
-
I am trying to add a dropdown list using a cus to my publish box
I can add the box no problem using a example from someone else’s post but the list just doesn’t populate with the custom taxonomy. The custom taxonomy is created in a plugin within a class and i’ve tried using the below in and out of the class to see if it makes a difference!
Anyone any ideas?
add_action( 'post_submitbox_misc_actions', 'publish_in_frontpage' ); function publish_in_frontpage($post) { $value = get_post_meta($post->ID, '_publish_in_frontpage', true); echo '<div class="misc-pub-section misc-pub-section-last"> <span id="timestamp">' . '<label><input type="checkbox"' . (!empty($value) ? ' checked="checked" ' : null) . 'value="1" name="publish_in_frontpage" /> Publish to frontpage</label>' .'</span></div>'; echo 'select type'; wp_dropdown_categories(array('taxonomy'=>'gb_deal', 'show_option_none'=>'select type')); } function save_postdata($postid) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false; if ( !current_user_can( 'edit_page', $postid ) ) return false; if(empty($postid) || $_POST['post_type'] != 'article' ) return false; if($_POST['action'] == 'editpost'){ delete_post_meta($postid, 'publish_in_frontpage'); } add_post_meta($postid, 'publish_in_frontpage', $_POST['publish_in_frontpage']); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘modify post submit box (add wp_dropdown_category with custom taxonomy)’ is closed to new replies.