loop_shop_per_page

loop_shop_per_page

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('loop_shop_per_page') is found 3 times:

  • /includes/class-wc-query.php line 534
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    $q->set( 'wc_query', 'product_query' );
    $q->set( 'post__in', array_unique( (array) apply_filters( 'loop_shop_post_in', array() ) ) );
     
    // Work out how many products to query.
    $q->set( 'posts_per_page', $q->get( 'posts_per_page' ) ? $q->get( 'posts_per_page' ) : apply_filters( 'loop_shop_per_page', wc_get_default_products_per_row() * wc_get_default_product_rows_per_page() ) );
     
    // Store reference to this query.
    self::$product_query = $q;
     
    // Additional hooks to change WP Query.
    add_filter( 'posts_clauses', array( $this, 'product_query_post_clauses' ), 10, 2 );
  • /src/Blocks/BlockTypes/ProductCollection/Controller.php line 239
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
        parent::enqueue_data( $attributes );
     
        // The `loop_shop_per_page` filter can be found in WC_Query::product_query().
        // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
        $this->asset_data_registry->add( 'loopShopPerPage', apply_filters( 'loop_shop_per_page', wc_get_default_products_per_row() * wc_get_default_product_rows_per_page() ) );
    }
     
    /**
     * Exposes settings used by the Product Collection block when manipulating
     * the default query.
     */
  • /src/Blocks/BlockTypes/ProductQuery.php line 137
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
        );
     
        // The `loop_shop_per_page` filter can be found in WC_Query::product_query().
        // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
        $this->asset_data_registry->add( 'loopShopPerPage', apply_filters( 'loop_shop_per_page', wc_get_default_products_per_row() * wc_get_default_product_rows_per_page() ) );
    }
     
    /**
     * Check if a given block
     *
     * @param array $parsed_block The block being rendered.