WC_Template_Loader::force_single_template_filter( string $template )
Force the loading of one of the single templates instead of whatever template was about to be loaded.
Description Description
Parameters Parameters
- $template
-
(Required) Path to template.
Return Return
(string)
Source Source
File: includes/class-wc-template-loader.php
public static function force_single_template_filter( $template ) { $possible_templates = array( 'page', 'single', 'singular', 'index', ); foreach ( $possible_templates as $possible_template ) { $path = get_query_template( $possible_template ); if ( $path ) { return $path; } } return $template; }
Changelog Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |