Sub_Nav::add_subnav_above_content( string $content )
Summary
No summary available.Parameters
- $content
-
(string) (Required)
Return
(string)
Source
File: src/BigCommerce/Gift_Certificates/Sub_Nav.php
public function add_subnav_above_content( $content ) { if ( ! is_singular() ) { return $content; } $post_id = get_queried_object_id(); if ( $post_id !== get_the_ID() ) { return $content; // don't filter if we're not on the main post } /** * Filter whether to display the gift certificate subnav before the post content * on gift certificate pages. * * @param bool $display True to display the subnav, false to skip it * @param int $post_id The ID of the current page */ if ( ! apply_filters( 'bigcommerce/gift_certificates/do_subnav', true, $post_id ) ) { return $content; } switch ( $post_id ) { case get_option( Pages\Gift_Certificate_Page::NAME, 0 ): case get_option( Pages\Check_Balance_Page::NAME, 0 ): return $this->get_subnav() . $content; default: return $content; } }