Ticket #5545: theme-tags.diff

File theme-tags.diff, 4.6 kB (added by andy, 10 months ago)
  • wp-includes/theme.php

    old new  
    9090        else 
    9191                $status = 'publish'; 
    9292 
     93        if ( preg_match('|Tags:(.*)|i', $theme_data, $tags) ) 
     94                $tags = array_map( 'trim', explode( ',', wp_kses( trim( $tags[1] ), array() ) ) ); 
     95        else 
     96                $tags = array(); 
     97 
    9398        $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags ); 
    9499        $theme_uri = clean_url( trim( $theme_uri[1] ) ); 
    95100        $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); 
     
    103108                $author = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $author_uri, __( 'Visit author homepage' ), wp_kses( trim( $author_name[1] ), $themes_allowed_tags ) ); 
    104109        } 
    105110 
    106         return array( 'Name' => $name, 'Title' => $theme, 'URI' => $theme_uri, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Status' => $status ); 
     111        return array( 'Name' => $name, 'Title' => $theme, 'URI' => $theme_uri, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Status' => $status, 'Tags' => $tags ); 
    107112} 
    108113 
    109114function get_themes() { 
     
    261266                        } 
    262267                } 
    263268 
    264                 $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot); 
     269                $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags']); 
    265270        } 
    266271 
    267272        // Resolve theme dependencies. 
  • wp-content/themes/classic/style.css

    old new  
    44Description: The original WordPress theme that graced versions 1.2.x and prior. 
    55Version: 1.5 
    66Author: Dave Shea 
     7Tags: mantle color, variable width, two columns, widgets 
    78 
    89Default WordPress by Dave Shea || http://mezzoblue.com 
    910Modifications by Matthew Mullenweg || http://photomatt.net 
  • wp-content/themes/default/style.css

    old new  
    55Version: 1.6 
    66Author: Michael Heilemann 
    77Author URI: http://binarybonsai.com/ 
     8Tags: blue, custom header, fixed width, two columns, widgets 
    89 
    910        Kubrick v1.5 
    1011         http://binarybonsai.com/kubrick/ 
  • wp-admin/includes/theme.php

    old new  
    1414        $ct->screenshot = $themes[$current_theme]['Screenshot']; 
    1515        $ct->description = $themes[$current_theme]['Description']; 
    1616        $ct->author = $themes[$current_theme]['Author']; 
     17        $ct->tags = $themes[$current_theme]['Tags']; 
    1718        return $ct; 
    1819} 
    1920 
  • wp-admin/themes.php

    old new  
    4040<?php } else { ?> 
    4141        <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p> 
    4242<?php } ?> 
     43<?php if ( $ct->tags ) : ?> 
     44<p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p> 
     45<?php endif; ?> 
    4346</div> 
    4447 
    4548<h2><?php _e('Available Themes'); ?></h2> 
     
    6265        $author = $themes[$theme_name]['Author']; 
    6366        $screenshot = $themes[$theme_name]['Screenshot']; 
    6467        $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir']; 
     68        $tags = $themes[$theme_name]['Tags']; 
    6569        $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); 
    6670?> 
    6771<div class="available-theme"> 
     
    7478</a> 
    7579 
    7680<p><?php echo $description; ?></p> 
     81<?php if ( $tags ) : ?> 
     82<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p> 
     83<?php endif; ?> 
    7784</div> 
    7885<?php } // end foreach theme_names ?> 
    7986