Make WordPress Core


Ignore:
Timestamp:
11/08/2021 11:09:53 PM (3 years ago)
Author:
noisysocks
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r52049 r52062  
    602602    public function get_custom_templates() {
    603603        $custom_templates = array();
    604         if ( ! isset( $this->theme_json['customTemplates'] ) ) {
     604        if ( ! isset( $this->theme_json['customTemplates'] ) || ! is_array( $this->theme_json['customTemplates'] ) ) {
    605605            return $custom_templates;
    606606        }
     
    626626    public function get_template_parts() {
    627627        $template_parts = array();
    628         if ( ! isset( $this->theme_json['templateParts'] ) ) {
     628        if ( ! isset( $this->theme_json['templateParts'] ) || ! is_array( $this->theme_json['templateParts'] ) ) {
    629629            return $template_parts;
    630630        }
Note: See TracChangeset for help on using the changeset viewer.