WordPress.org

Make WordPress Core

Ticket #7091: 7091.3.diff

File 7091.3.diff, 3.6 KB (added by DD32, 6 years ago)
  • wp-admin/plugins.php

     
    197197<p><?php _e('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.'); ?></p> 
    198198<?php 
    199199 
     200$all_plugins = get_plugins(); 
    200201$active_plugins = array(); 
    201 $available_plugins = array(); 
     202$inactive_plugins = array(); 
    202203$recent_plugins = array(); 
    203204$recently_activated = (array)get_option('recently_activated'); 
    204205 
     
    209210if( $recently_activated != get_option('recently_activated') ) //If array changed, update it. 
    210211        update_option('recently_activated', $recently_activated); 
    211212 
    212 $all_plugins = get_plugins(); 
    213  
    214213$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); 
    215214 
    216215foreach( (array)$all_plugins as $plugin_file => $plugin_data) { 
     
    223222        if( ! empty($plugin_data['Author']) ) 
    224223                $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; 
    225224 
     225        //Filter into individual sections 
    226226        if ( is_plugin_active($plugin_file) ) { 
    227227                $active_plugins[ $plugin_file ] = $plugin_data; 
    228228        } else { 
    229229                if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated? 
    230230                        $recent_plugins[ $plugin_file ] = $plugin_data; 
    231231                else 
    232                         $available_plugins[ $plugin_file ] = $plugin_data; 
     232                        $inactive_plugins[ $plugin_file ] = $plugin_data; 
    233233        } 
    234234} 
    235235 
     
    289289} //End print_plugins_table() 
    290290?> 
    291291 
     292<?php if ( ! empty($active_plugins) ) : ?> 
    292293<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3> 
    293294<form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
    294295<?php wp_nonce_field('bulk-manage-plugins') ?> 
     
    303304</form> 
    304305 
    305306<p><?php printf(__('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?></p> 
     307<?php endif; ?> 
    306308 
    307309<?php if ( ! empty($recent_plugins) ) : ?> 
    308310<h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3> 
     
    322324</form> 
    323325<?php endif; ?> 
    324326 
    325 <h3 id="available-plugins"><?php _e('Available Plugins') ?></h3> 
     327<?php if ( ! empty($inactive_plugins) ) : ?> 
     328<h3 id="inactive-plugins"><?php _e('Inactive Plugins') ?></h3> 
    326329<form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
    327330<?php wp_nonce_field('bulk-manage-plugins') ?> 
    328331 
    329 <?php if ( ! empty($available_plugins) ) : ?> 
    330332<div class="tablenav"> 
    331333        <div class="alignleft"> 
    332334                <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" /> 
     
    336338        </div> 
    337339</div> 
    338340<br class="clear" /> 
    339 <?php print_plugins_table($available_plugins, 'available') ?> 
     341<?php print_plugins_table($inactive_plugins, 'inactive') ?> 
    340342</form> 
    341343<?php endif; ?> 
    342344 
     345<?php if ( empty($all_plugins) ) : ?> 
     346<p><?php _e('You do not appear to have any plugins available at this time.') ?></p> 
     347<?php endif; ?> 
     348 
    343349<h2><?php _e('Get More Plugins'); ?></h2> 
    344350<p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>.'); ?></p> 
    345351<p><?php printf(__('To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.'), WP_PLUGIN_DIR); ?></p>