woocommerce_default_catalog_orderby

woocommerce_default_catalog_orderby

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_default_catalog_orderby') is found 4 times:

  • /includes/class-wc-query.php line 604
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    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 1525
    1521
    1522
    1523
    1524
    1525
    1526
    1527
    1528
    1529
    1530
    * @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 1584
    1580
    1581
    1582
    1583
    1584
    1585
    1586
    1587
    1588
    1589
    1590
    * @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 1619
    1615
    1616
    1617
    1618
    1619
    1620
    1621
    1622
    1623
    1624
    1625
            )
        );
    }
     
    $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 );