WordPress.org

Make WordPress Core

Ticket #6015: 6015.5.diff

File 6015.5.diff, 2.1 KB (added by DD32, 6 years ago)
  • wp-admin/plugin-install.php

     
    2222wp_enqueue_script( 'plugin-install' ); 
    2323add_thickbox(); 
    2424 
    25 //These are the tabs which are shown on the page, Note that 'install' and 'plugin-information' are valid hooks, but not shown here due to not requiring the header 
    26 $tabs = array( 
    27                         'search'        => __('Search Plugins'), 
    28                         'upload'        => __('Upload a Plugin'), 
    29                         'featured'      => __('Featured Plugins'), 
    30                         'popular'       => __('Popular Plugins'), 
    31                         'new'           => __('Newest Plugins'), 
    32                         'updated'       => __('Recently Updated Plugins') 
    33                 ); 
     25//These are the tabs which are shown on the page, 
     26$tabs = array(); 
     27$tabs['dashboard'] = __('Start Page'); //TODO: Better name? 
     28if ( 'search' == $tab ) 
     29        $tabs['search'] = __('Search Results'); 
     30$tabs['featured'] = __('Featured'); 
     31$tabs['popular']  = __('Popular'); 
     32$tabs['new']      = __('Newest'); 
     33$tabs['updated']  = __('Recently Updated'); 
    3434 
     35$nonmenu_tabs = array('install', 'plugin-information', 'upload'); //Valid actions to perform which do not have a Menu item. 
     36 
    3537$tabs = apply_filters('install_plugins_tabs', $tabs ); 
     38$nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs); 
    3639 
    37 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, array('install', 'plugin-information')) ) ){ 
     40//If a non-valid menu tab has been selected, And its not a non-menu action. 
     41if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { 
    3842        $tab_actions = array_keys($tabs); 
    3943        $tab = $tab_actions[0]; 
    4044} 
     
    4347 
    4448$body_id = $tab; 
    4549 
    46 do_action('install_plugins_pre_' . $tab); 
     50do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information. 
    4751 
    4852include('admin-header.php'); 
    4953?> 
     
    5963} 
    6064?> 
    6165        </ul> 
     66        <br class="clear" /> 
    6267        <?php do_action('install_plugins_' . $tab, $paged); ?> 
    6368</div> 
    6469<?php 
    6570include('admin-footer.php'); 
    66 ?> 
    67  No newline at end of file 
     71?>