woocommerce_sortable_taxonomies, array( product_cat

woocommerce_sortable_taxonomies, array( product_cat

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.11.0.0

apply_filters('woocommerce_sortable_taxonomies, array( product_cat') is found 4 times:

  • /includes/admin/class-wc-admin-assets.php line 737
    			}
    
    			// Term ordering - only when sorting by term_order.
    			/* phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment */
    			if ( ( strstr( $screen_id, 'edit-pa_' ) || ( ! empty( $_GET['taxonomy'] ) && in_array( wp_unslash( $_GET['taxonomy'] ), apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ) ) ) ) && ! isset( $_GET['orderby'] ) ) {
    
    				wp_register_script( 'woocommerce_term_ordering', WC()->plugin_url() . '/assets/js/admin/term-ordering' . $suffix . '.js', array( 'jquery-ui-sortable' ), $version );
    				wp_enqueue_script( 'woocommerce_term_ordering' );
    
    				$taxonomy = isset( $_GET['taxonomy'] ) ? wc_clean( wp_unslash( $_GET['taxonomy'] ) ) : '';
    
    
  • /includes/wc-term-functions.php line 33
    	$orderby  = 'name';
    
    	if ( taxonomy_is_product_attribute( $taxonomy ) ) {
    		$orderby = wc_attribute_orderby( $taxonomy );
    	} elseif ( in_array( $taxonomy, apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ), true ) ) {
    		$orderby = 'menu_order';
    	}
    
    	// Change defaults. Invalid values will be changed later @see wc_change_pre_get_terms.
    	// These are in place so we know if a specific order was requested.
    	switch ( $orderby ) {
    
  • /src/Blocks/BlockTypes/ProductFilterTaxonomy.php line 113
    		 *
    		 * @param array $sortable_taxonomies List of taxonomy slugs that support custom ordering.
    		 * @return array List of taxonomy slugs that support custom ordering.
    		 */
    		$sortable_taxonomies = apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) );
    
    		foreach ( $sortable_taxonomies as $taxonomy ) {
    			register_rest_field(
    				$taxonomy,
    				'menu_order',
    				array(
    
  • /src/Blocks/BlockTypes/ProductFilterTaxonomy.php line 161
    				 *
    				 * @param array $sortable_taxonomies List of taxonomy slugs that support custom ordering.
    				 * @return array List of taxonomy slugs that support custom ordering.
    				 */
    				apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) )
    			);
    		}
    	}
    
    	/**
    	 * Get the frontend script handle for this block type.