Make WordPress Core

Ticket #37495: uploader-filter2.diff

File uploader-filter2.diff, 1.5 KB (added by DavidAnderson, 9 years ago)

Second version which prevents double-call of the action when visiting the uploads tab directly

  • wp-admin/plugin-install.php

     
    130130 * Output the upload plugin form on every plugin install screen, so it can be
    131131 * displayed via JavaScript rather then opening up the devoted upload plugin page.
    132132 */
    133 install_plugins_upload(); ?>
     133 
     134/**
     135 * Fires after the plugins list table in each tab of the Install Plugins screen.
     136 *
     137 * @since 2.7
     138 *
     139 */
     140do_action('install_plugins_upload'); ?>
    134141</div>
    135142
    136143<?php
     
    149156 *
    150157 * @param int $paged The current page number of the plugins list table.
    151158 */
    152 do_action( "install_plugins_$tab", $paged ); ?>
     159if ( $tab !== 'upload' ) do_action( "install_plugins_$tab", $paged ); ?>
    153160
    154161        <span class="spinner"></span>
    155162</div>
  • wp-admin/includes/admin-filters.php

     
    7070
    7171// Plugin Install hooks.
    7272add_action( 'install_plugins_featured',               'install_dashboard' );
     73add_action( 'install_plugins_upload',                 'install_plugins_upload' );
    7374add_action( 'install_plugins_search',                 'display_plugins_table' );
    7475add_action( 'install_plugins_popular',                'display_plugins_table' );
    7576add_action( 'install_plugins_recommended',            'display_plugins_table' );