Make WordPress Core

Changeset 26531


Ignore:
Timestamp:
12/02/2013 06:57:32 PM (11 years ago)
Author:
nacin
Message:

For the current theme, display all available actions, as dictated by the admin menu.

Restores 3.7 behavior. This could include things like Header and Background as well as theme options pages.

see #25948.

File:
1 edited

Legend:

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

    r26524 r26531  
    8282
    8383get_current_screen()->set_help_sidebar(
    84     '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    85     '<p>' . __( '<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>' ) . '</p>' . 
    86     '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' 
     84    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     85    '<p>' . __( '<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>' ) . '</p>' .
     86    '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
    8787);
    8888
     
    146146if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
    147147    && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>
    148 
    149     <?php
     148*/
     149
    150150    // Pretend you didn't see this.
    151     $options = array();
     151    $current_theme_actions = array();
    152152    if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
    153153        foreach ( (array) $submenu['themes.php'] as $item) {
     
    162162                $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
    163163                if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
    164                     $options[] = "<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
     164                    $current_theme_actions[] = "<a class='button button-secondary' href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
    165165                else
    166                     $options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
     166                    $current_theme_actions[] = "<a class='button button-secondary' href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
    167167            } else if ( current_user_can($item[1]) ) {
    168168                $menu_file = $item[2];
     
    170170                    $menu_file = substr( $menu_file, 0, $pos );
    171171                if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
    172                     $options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
     172                    $current_theme_actions[] = "<a class='button button-secondary' href='{$item[2]}'$class>{$item[0]}</a>";
    173173                } else {
    174                     $options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
     174                    $current_theme_actions[] = "<a class='button button-secondary' href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
    175175                }
    176176            }
    177177        }
    178178    }
    179 */
     179
    180180?>
    181181
     
    271271                <h3 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span></h3>
    272272                <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></h4>
    273    
     273
    274274                <# if ( data.hasUpdate ) { #>
    275275                <div class="theme-update-message">
     
    279279                <# } #>
    280280                <p class="theme-description">{{{ data.description }}}</p>
    281    
     281
    282282                <# if ( data.parent ) { #>
    283283                    <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
    284284                <# } #>
    285    
     285
    286286                <# if ( data.tags ) { #>
    287287                    <p class="theme-tags">
     
    296296            <div class="active-theme">
    297297                <a href="{{{ data.actions.customize }}}" class="button button-primary hide-if-no-customize"><?php _e( 'Customize' ); ?></a>
    298                 <?php if ( current_theme_supports( 'menus' ) ) { ?>
    299                 <a class="button button-secondary" href="<?php echo admin_url( 'nav-menus.php' ); ?>"><?php _e( 'Menus' ); ?></a>
    300                 <?php } ?>
    301                 <?php if ( current_theme_supports( 'widgets' ) ) { ?>
    302                 <a class="button button-secondary" href="<?php echo admin_url( 'widgets.php' ); ?>"><?php _e( 'Widgets' ); ?></a>
    303                 <?php } ?>
     298                <?php echo implode( ' ', $current_theme_actions ); ?>
    304299            </div>
    305300            <div class="inactive-theme">
     
    309304                <a href="{{{ data.actions.customize }}}" class="button button-secondary"><?php _e( 'Live Preview' ); ?></a>
    310305            </div>
    311    
     306
    312307            <# if ( ! data.active && data.actions.delete ) { #>
    313308                <a href="{{{ data.actions.delete }}}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a>
Note: See TracChangeset for help on using the changeset viewer.