loop_shop_per_page

loop_shop_per_page

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

See hook in core

Displaying hooks found in version: woocommerce.9.9.5

apply_filters('loop_shop_per_page') is found 3 times:

  • /includes/class-wc-query.php line 534
    		$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 224
    		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
    		);
    
    		// 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.