loop_shop_per_page

loop_shop_per_page

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

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('loop_shop_per_page') is found 3 times:

  • /includes/class-wc-query.php line 536
    		$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.
    		self::add_filter( 'posts_clauses', array( $this, 'product_query_post_clauses' ), 10, 2 );
    
  • /src/Blocks/BlockTypes/ProductCollection.php line 509
    		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() ) );
    	}
    
    	/**
    	 * Update the query for the product query block in Editor.
    	 *
    	 * @param array           $args    Query args.
    
  • /src/Blocks/BlockTypes/ProductQuery.php line 135
    		);
    
    		// 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.