woocommerce_taxonomy_args_product_cat

The WooCommerce woocommerce taxonomy args product cat hook.

Description

apply_filters( 'woocommerce_taxonomy_args_product_cat', (callback) $array ); 

Parameters (1)

0. $array — Optional. (callback) => array( 'hierarchical' => true, 'update_count_callback' => '_wc_term_recount', 'label' => __( 'Categories', 'woocommerce' ), 'labels' => array( 'name' => __( 'Product categories', 'woocommerce' ), 'singular_name' => __( 'Category', 'woocommerce' ), 'menu_name' => _x( 'Categories', 'Admin menu name', 'woocommerce' ), 'search_items' => __( 'Search categories', 'woocommerce' ), 'all_items' => __( 'All categories', 'woocommerce' ), 'parent_item' => __( 'Parent category', 'woocommerce' ), 'parent_item_colon' => __( 'Parent category:', 'woocommerce' ), 'edit_item' => __( 'Edit category', 'woocommerce' ), 'update_item' => __( 'Update category', 'woocommerce' ), 'add_new_item' => __( 'Add new category', 'woocommerce' ), 'new_item_name' => __( 'New category name', 'woocommerce' ), 'not_found' => __( 'No categories found', 'woocommerce' ), ), 'show_ui' => true, 'query_var' => true, 'capabilities' => array( 'manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms', ), 'rewrite' => array( 'slug' => $permalinks['category_rewrite_slug'], 'with_front' => false, 'hierarchical' => true, ), )
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'woocommerce_taxonomy_args_product_cat', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_taxonomy_args_product_cat callback 
  2. function filter_woocommerce_taxonomy_args_product_cat( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_taxonomy_args_product_cat', 'filter_woocommerce_taxonomy_args_product_cat', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_taxonomy_args_product_cat', 'filter_woocommerce_taxonomy_args_product_cat', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-post-types.php  
  1. apply_filters( 'woocommerce_taxonomy_args_product_cat', array(