WordPress.org

Make WordPress Core

Ticket #16395: theme.php.diff

File theme.php.diff, 2.2 KB (added by cais, 3 years ago)
  • wp-includes/theme.php

     
    171171 * 
    172172 * The style.css file must contain theme name, theme URI, and description. The 
    173173 * data can also contain author URI, author, template (parent template), 
    174  * version, status, and finally tags. Some of these are not used by WordPress 
    175  * administration panels, but are used by theme directory web sites which list 
    176  * the theme. 
     174 * template version (parent template version), version, status, and finally 
     175 * tags. Some of these are not used by WordPress administration panels, but are 
     176 * used by theme directory web sites which list the theme. 
    177177 * 
    178178 * @since 1.5.0 
    179179 * 
     
    189189                'AuthorURI' => 'Author URI', 
    190190                'Version' => 'Version', 
    191191                'Template' => 'Template', 
     192                'Template_Version' => 'Template Version', 
    192193                'Status' => 'Status', 
    193194                'Tags' => 'Tags' 
    194195                ); 
     
    219220        $theme_data['AuthorURI'] = esc_url( $theme_data['AuthorURI'] ); 
    220221 
    221222        $theme_data['Template'] = wp_kses( $theme_data['Template'], $themes_allowed_tags ); 
     223         
     224        $theme_data['Template_Version'] = wp_kses( $theme_data['Template_Version'], $themes_allowed_tags ); 
     225         
     226        // if there is no template being used then there should not be a value for the template version. 
     227        if ( $theme_data['Template'] == '' ) 
     228                $theme_data['Template_Version'] = ''; 
    222229 
    223230        $theme_data['Version'] = wp_kses( $theme_data['Version'], $themes_allowed_tags ); 
    224231 
     
    291298                $version     = $theme_data['Version']; 
    292299                $author      = $theme_data['Author']; 
    293300                $template    = $theme_data['Template']; 
     301                $template_version    = $theme_data['Template_Version']; 
    294302                $stylesheet  = dirname($theme_file); 
    295303 
    296304                $screenshot = false; 
     
    307315                } 
    308316 
    309317                $parent_template = $template; 
     318                $parent_template_version = $template_version; 
    310319 
    311320                if ( empty($template) ) { 
    312321                        if ( file_exists("$theme_root/$stylesheet/index.php") ) 
     
    425434                        'Author URI' => $theme_data['AuthorURI'], 
    426435                        'Version' => $version, 
    427436                        'Template' => $template, 
     437                        'Template Version' => $template_version, 
    428438                        'Stylesheet' => $stylesheet, 
    429439                        'Template Files' => $template_files, 
    430440                        'Stylesheet Files' => $stylesheet_files,