Display a custom taxonomy dropdown in admin

add_action('restrict_manage_posts', 'function_name'); function function_name() { global $typenow; $post_type = 'xxxxx'; $taxonomy = 'xxxxx'; $selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : ''; $info_taxonomy = get_taxonomy($taxonomy); wp_dropdown_categories(array( 'show_option_all' => __("Show All {$info_taxonomy->label}"), 'taxonomy' => $taxonomy, 'name' => $taxonomy, 'orderby' => 'name', 'selected' => $selected, 'show_count' => true, 'hide_empty' => true, )); }; }
Display a custom taxonomy dropdown in admin

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.