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

do_action('woocommerce_before_main_content') is found 4 times:

  • /src/Blocks/BlockTypes/ClassicTemplate.php line 201
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    * @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
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    * @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
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
         *
         * @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: