WC_Template_Loader::unsupported_theme_product_content_filter()
Filter the content and insert WooCommerce content on the shop page.
For non-WC themes, this will setup the main shop page to be shortcode based to improve default appearance.
Method of the class: WC_Template_Loader{}
No Hooks.
Return
String
.
Usage
$result = WC_Template_Loader::unsupported_theme_product_content_filter( $content );
- $content(string) (required)
- Existing post content.
Changelog
Since 3.3.0 | Introduced. |
WC_Template_Loader::unsupported_theme_product_content_filter() WC Template Loader::unsupported theme product content filter code WC 9.4.2
public static function unsupported_theme_product_content_filter( $content ) { global $wp_query; if ( self::$theme_support || ! is_main_query() || ! in_the_loop() ) { return $content; } self::$in_content_filter = true; // Remove the filter we're in to avoid nested calls. remove_filter( 'the_content', array( __CLASS__, 'unsupported_theme_product_content_filter' ) ); if ( is_product() ) { $content = do_shortcode( '[product_page id="' . get_the_ID() . '" show_title=0 status="any"]' ); } self::$in_content_filter = false; return $content; }