mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 02:04:26 +00:00
Editor: Add block theme infrastructure
Adds the required infrastructure to render block-based themes. This is sourced from the Gutenberg plugin. Fixes #54335. Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya. git-svn-id: https://develop.svn.wordpress.org/trunk@52062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -601,7 +601,7 @@ class WP_Theme_JSON {
|
||||
*/
|
||||
public function get_custom_templates() {
|
||||
$custom_templates = array();
|
||||
if ( ! isset( $this->theme_json['customTemplates'] ) ) {
|
||||
if ( ! isset( $this->theme_json['customTemplates'] ) || ! is_array( $this->theme_json['customTemplates'] ) ) {
|
||||
return $custom_templates;
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ class WP_Theme_JSON {
|
||||
*/
|
||||
public function get_template_parts() {
|
||||
$template_parts = array();
|
||||
if ( ! isset( $this->theme_json['templateParts'] ) ) {
|
||||
if ( ! isset( $this->theme_json['templateParts'] ) || ! is_array( $this->theme_json['templateParts'] ) ) {
|
||||
return $template_parts;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user