Make WordPress Core

Ticket #16395: 16395.patch

File 16395.patch, 2.2 KB (added by cais, 9 years ago)

Modified class-wp-theme.php file (only)

  • wp-includes/class-wp-theme.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3232                'AuthorURI'   => 'Author URI',
    3333                'Version'     => 'Version',
    3434                'Template'    => 'Template',
     35                'Template_Version'  => 'Template Version',
    3536                'Status'      => 'Status',
    3637                'Tags'        => 'Tags',
    3738                'TextDomain'  => 'Text Domain',
     
    337338         */
    338339        public function __isset( $offset ) {
    339340                static $properties = array(
    340                         'name', 'title', 'version', 'parent_theme', 'template_dir', 'stylesheet_dir', 'template', 'stylesheet',
     341                        'name', 'title', 'version', 'parent_theme', 'template_dir', 'stylesheet_dir', 'template', 'template_version', 'stylesheet',
    341342                        'screenshot', 'description', 'author', 'tags', 'theme_root', 'theme_root_uri',
    342343                );
    343344
     
    364365                                return $this->get_stylesheet_directory();
    365366                        case 'template' :
    366367                                return $this->get_template();
     368                        case 'template_version' :
     369                                if ( is_child_theme() ) {
     370                                        return $this->parent()->get( 'Version' );
     371                                } else {
     372                                        return null;
     373                                }
    367374                        case 'stylesheet' :
    368375                                return $this->get_stylesheet();
    369376                        case 'screenshot' :
     
    411418        public function offsetExists( $offset ) {
    412419                static $keys = array(
    413420                        'Name', 'Version', 'Status', 'Title', 'Author', 'Author Name', 'Author URI', 'Description',
    414                         'Template', 'Stylesheet', 'Template Files', 'Stylesheet Files', 'Template Dir', 'Stylesheet Dir',
     421                        'Template', 'Template Version', 'Stylesheet', 'Template Files', 'Stylesheet Files', 'Template Dir', 'Stylesheet Dir',
    415422                        'Screenshot', 'Tags', 'Theme Root', 'Theme Root URI', 'Parent Theme',
    416423                );
    417424
     
    451458                                return $this->get( $offset );
    452459                        case 'Template' :
    453460                                return $this->get_template();
     461                        case 'Template Version' :
     462                                if ( is_child_theme() ) {
     463                                        return $this->parent()->get( 'Version' );
     464                                } else {
     465                                        return null;
     466                                }
    454467                        case 'Stylesheet' :
    455468                                return $this->get_stylesheet();
    456469                        case 'Template Files' :