woocommerce_default_catalog_orderby

woocommerce_default_catalog_orderby

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.9.5

apply_filters('woocommerce_default_catalog_orderby') is found 4 times:

  • /includes/class-wc-query.php line 604
    			if ( ! $orderby_value ) {
    				if ( is_search() ) {
    					$orderby_value = 'relevance';
    				} else {
    					$orderby_value = apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby', 'menu_order' ) );
    				}
    			}
    
    			// Get order + orderby args from string.
    			$orderby_value = is_array( $orderby_value ) ? $orderby_value : explode( '-', $orderby_value );
    			$orderby       = esc_attr( $orderby_value[0] );
    
  • /includes/wc-template-functions.php line 1534
    		 * @since 1.6.4
    		 *
    		 * @param string  $default_orderby The default orderby option.
    		 */
    		$default_orderby = apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby', '' ) );
    		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
    		$orderby = isset( $_GET['orderby'] ) ? wc_clean( wp_unslash( $_GET['orderby'] ) ) : $default_orderby;
    
    		// If products follow the default order this doesn't need to be informed.
    		$orderby = 'menu_order' === $orderby ? '' : $orderby;
    
    
  • /includes/wc-template-functions.php line 1593
    		 * @since 1.6.4
    		 *
    		 * @param string $default_orderby The default orderby option.
    		 */
    		$show_default_orderby = 'menu_order' === apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby', 'menu_order' ) );
    
    		if ( isset( $attributes ) && isset( $attributes['useLabel'] ) && $attributes['useLabel'] ) {
    			/**
    			 * Filters the catalog orderby options.
    			 *
    			 * @since 9.7.0
    
  • /includes/wc-template-functions.php line 1628
    				)
    			);
    		}
    
    		$default_orderby = wc_get_loop_prop( 'is_search' ) ? 'relevance' : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby', '' ) );
    		// phpcs:disable WordPress.Security.NonceVerification.Recommended
    		$orderby = isset( $_GET['orderby'] ) ? wc_clean( wp_unslash( $_GET['orderby'] ) ) : $default_orderby;
    		// phpcs:enable WordPress.Security.NonceVerification.Recommended
    
    		if ( wc_get_loop_prop( 'is_search' ) ) {
    			$catalog_orderby_options = array_merge( array( 'relevance' => __( 'Relevance', 'woocommerce' ) ), $catalog_orderby_options );