Taxonomy Filter on Admin Area
-
Hello Friends,
I have added this code to the function.php to show admin filter but when I chose any tax still send me to show all tax. so what is wrong with the below code, please.add_action('restrict_manage_posts', 'product_type_filter'); function product_type_filter() { global $typenow; $post_type = 'accommodations'; $taxonomy = 'events-categories'; if ($typenow == $post_type) { $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, 'value_field' => 'slug', 'show_count' => true, 'hide_empty' => true, )); }; }
- This topic was modified 4 years, 10 months ago by .
- This topic was modified 4 years, 10 months ago by . Reason: code fixed
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Taxonomy Filter on Admin Area’ is closed to new replies.