There is some missing parts in your code:
Try the following:
add_action('restrict_manage_posts', 'admin_products_by_manufacturer_filter_dropdown');
function admin_products_by_manufacturer_filter_dropdown() {
global $typenow, $pagenow;
$taxonomy = 'vyrobca'; // The custom taxonomy
if( 'edit.php' === $pagenow && 'product' === $typenow && taxonomy_exists( $taxonomy ) ) {
$info_taxonomy = get_taxonomy($taxonomy);
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : '';
wp_dropdown_categories( array(
'show_option_all' => sprintf( __("Zobraziť všetkých %s", "woocommerce"), $info_taxonomy->label ),
'taxonomy' => $taxonomy,
'name' => $taxonomy,
'selected' => $selected,
'orderby' => 'name',
'show_count' => true,
'hide_empty' => true,
) );
}
}
add_action('parse_query', 'admin_products_by_manufacturer_filter_query');
function admin_products_by_manufacturer_filter_query( $query ) {
global $typenow, $pagenow;
$taxonomy = 'vyrobca'; // The custom taxonomy
if ( 'edit.php' === $pagenow && 'product' === $typenow && taxonomy_exists( $taxonomy ) ) {
$q_vars = &$query->query_vars;
if ( isset($q_vars[$taxonomy]) && is_numeric($q_vars[$taxonomy]) && $q_vars[$taxonomy] != 0 ) {
$term = get_term_by('id', $q_vars[$taxonomy], $taxonomy);
$q_vars[$taxonomy] = $term->slug;
}
}
}
Code goes in functions.php file of your active child theme (or active theme). It should works.