woocommerce_taxonomy_args_product_cat
Usage
add_filter( 'woocommerce_taxonomy_args_product_cat', 'wp_kama_woocommerce_taxonomy_args_product_cat_filter' ); /** * Function for `woocommerce_taxonomy_args_product_cat` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_taxonomy_args_product_cat_filter( $array ){ // filter... return $array; }
- $array
- -
Where the hook is called
woocommerce_taxonomy_args_product_cat
woocommerce/includes/class-wc-post-types.php 91-129
apply_filters( 'woocommerce_taxonomy_args_product_cat', 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' ), 'item_link' => __( 'Product Category Link', 'woocommerce' ), 'item_link_description' => __( 'A link to a product category.', 'woocommerce' ), 'template_name' => _x( 'Products by Category', 'Template name', 'woocommerce' ), ), 'show_in_rest' => true, '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, ), ) )
Where the hook is used in WooCommerce
woocommerce/src/Admin/Features/AsyncProductEditorCategoryField/Init.php 27
add_filter( 'woocommerce_taxonomy_args_product_cat', array( $this, 'add_metabox_args' ) );