Created
May 9, 2020 19:10
-
-
Save Oscar-Abad-Folgueira/14ddca705d3e4533c86eff095f6bbf9a to your computer and use it in GitHub Desktop.
WooCommerce Snippet: Excluir categorías de la lista de categorías
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @snippet WooCommerce Snippet: Excluir categorías de la lista de categorías | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com//woocommerce-snippet-excluir-categorias-la-lista-categorias/ | |
*/ | |
add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'oaf_wc_exclude_categories_from_list_widget' ); | |
add_filter( 'woocommerce_product_categories_widget_args', 'oaf_wc_exclude_categories_from_list_widget' ); | |
function oaf_wc_exclude_categories_from_list_widget( $cat_args ) { | |
$cat_args['exclude'] = array('14','17'); | |
return $cat_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment