WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/14/2004 06:19:50 AM (17 years ago)
Author:
rboren
Message:

Refactor some theme code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r1638 r1643  
    3131<?php
    3232$themes = get_themes();
    33 $theme_names = array_keys($themes);
    34 natcasesort($theme_names);
    35 $current_template = get_settings('template');
    36 $current_stylesheet = get_settings('stylesheet');
    37 $current_theme = 'Default';
    38 $current_parent_theme = '';
    39 $current_template_dir = '/';
    40 $current_stylesheet_dir = '/';
    41 
    42 if ($themes) {
    43     foreach ($theme_names as $theme_name) {
    44         if ($themes[$theme_name]['Stylesheet'] == $current_stylesheet &&
    45                 $themes[$theme_name]['Template'] == $current_template) {
    46             $current_theme = $themes[$theme_name]['Name'];
    47             if ($current_template != 'default')
    48                 $current_template_dir = dirname($themes[$theme_name]['Template Files'][0]);
    49             if ($current_stylesheet != 'default')
    50                 $current_stylesheet_dir = dirname($themes[$theme_name]['Stylesheet Files'][0]);
    51         }
    52 
    53         if (($current_template != $current_stylesheet) &&
    54                 ($themes[$theme_name]['Stylesheet'] == $themes[$theme_name]['Template']) &&
    55                 ($themes[$theme_name]['Template'] == $current_template)) {
    56             $current_parent_theme = $themes[$theme_name]['Name'];
    57         }
    58     }
    59 }
     33$current_theme = get_current_theme();
     34$current_parent_theme = $themes[$current_theme]['Parent Theme'];
     35$current_template_dir = $themes[$current_theme]['Template Dir'];
     36$current_stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
     37$current_template = $themes[$current_theme]['Template'];
     38$current_stylesheet = $themes[$current_theme]['Stylesheet'];
    6039?>
    6140
Note: See TracChangeset for help on using the changeset viewer.