woocommerce_before_main_content

woocommerce_before_main_content

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_before_main_content') is found 4 times:

  • /src/Blocks/BlockTypes/ClassicTemplate.php line 201
    		 * @see WC_Structured_Data::generate_website_data() Outputs schema markup (priority 30)
    		 *
    		 * @since 6.3.0
    		 */
    		do_action( 'woocommerce_before_main_content' );
    
    		$product_query = new \WP_Query(
    			array(
    				'post_type' => 'product',
    				'p'         => get_the_ID(),
    			)
    
  • /src/Blocks/BlockTypes/ClassicTemplate.php line 252

    * @see WC_Structured_Data::generate_website_data() Outputs schema markup (priority 30)
    *
    * @since 6.3.0
    */
    do_action( ‘woocommerce_before_main_content’ );

    ?>

  • /templates/archive-product.php line 29
     * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
     * @hooked woocommerce_breadcrumb - 20
     * @hooked WC_Structured_Data::generate_website_data() - 30
     */
    do_action( 'woocommerce_before_main_content' );
    
    /**
     * Hook: woocommerce_shop_loop_header.
     *
     * @since 8.6.0
     *
    
  • /templates/single-product.php line 31
    		 *
    		 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
    		 * @hooked woocommerce_breadcrumb - 20
    		 */
    		do_action( 'woocommerce_before_main_content' );
    	?>
    
    		<?php while ( have_posts() ) : ?>
    			<?php the_post(); ?>
    
    			<?php wc_get_template_part( 'content', 'single-product' ); ?>
    

See this hook used in plugins: