File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,11 @@ public function pre_get_posts( $query ) {
131131
132132
133133 /**
134- * Force page template types.
134+ * Use page template types.
135+ *
136+ * Instead of just locating one page template with the highest priority,
137+ * we are going to look for any page template that matches 'page.php', 'single.php' or 'index.php'.
138+ * This resolves issues with Block Based themes that do not have a index.php.
135139 *
136140 * @since 1.6.12
137141 * @param array $templates The list of templates in descending order of priority from WordPress.
@@ -140,7 +144,7 @@ public function pre_get_posts( $query ) {
140144 */
141145 public function use_page_template_hierarchy ( $ templates ) {
142146
143- return [ 'page.php ' , 'single.php ' , 'index.php ' ] ;
147+ return array ( 'page.php ' , 'single.php ' , 'index.php ' ) ;
144148 }
145149 /**
146150 * Limit the page templates to singular pages only
@@ -150,6 +154,6 @@ public function use_page_template_hierarchy( $templates ) {
150154 */
151155 public function template_include ( ) {
152156 _deprecated_function ( __METHOD__ , 'WeForms 1.6.11 ' );
153- return locate_template ( [ 'page.php ' , 'single.php ' , 'index.php ' ] );
157+ return locate_template ( array ( 'page.php ' , 'single.php ' , 'index.php ' ) );
154158 }
155159}
You can’t perform that action at this time.
0 commit comments