woocommerce_sortable_taxonomies

woocommerce_sortable_taxonomies

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_sortable_taxonomies') is found 2 times:

  • /includes/admin/class-wc-admin-assets.php line 452
    			}
    
    			// 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 31
    	$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 ) {
    

See this hook used in plugins: