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.8.7.0

do_action('woocommerce_before_main_content') is found 4 times:

  • /src/Blocks/BlockTypes/ClassicTemplate.php line 199
    		 * @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 250

    * @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' );
    
    ?>
    <header class="woocommerce-products-header">
    	<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
    		<h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1>
    	<?php endif; ?>
    
  • /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: