Make WordPress Core

Ticket #13071: 13071.2.patch

File 13071.2.patch, 1.7 KB (added by ocean90, 8 years ago)
  • src/wp-admin/includes/admin-filters.php

     
    9696add_action( 'profile_update', 'default_password_nag_edit_user', 10, 2 );
    9797
    9898// Update hooks.
    99 add_action( 'admin_init', 'wp_plugin_update_rows' );
    100 add_action( 'admin_init', 'wp_theme_update_rows'  );
     99add_action( 'after_plugin_row', 'wp_plugin_update_rows', 10, 0 ); // Needs to run after wp_update_plugins().
     100add_action( 'after_theme_row', 'wp_theme_update_rows', 10, 0 ); // Needs to run after wp_update_themes().
    101101
    102102add_action( 'admin_notices', 'update_nag',      3  );
    103103add_action( 'admin_notices', 'maintenance_nag', 10 );
  • src/wp-admin/includes/update.php

     
    296296 * @since 2.9.0
    297297 */
    298298function wp_plugin_update_rows() {
    299         if ( !current_user_can('update_plugins' ) )
     299        remove_action( 'after_plugin_row', 'wp_plugin_update_rows' );
     300
     301        if ( ! current_user_can( 'update_plugins' ) ) {
    300302                return;
     303        }
    301304
    302305        $plugins = get_site_transient( 'update_plugins' );
    303306        if ( isset($plugins->response) && is_array($plugins->response) ) {
     
    432435 * @since 3.1.0
    433436 */
    434437function wp_theme_update_rows() {
    435         if ( !current_user_can('update_themes' ) )
     438        remove_action( 'after_theme_row', 'wp_theme_update_rows' );
     439
     440        if ( ! current_user_can( 'update_themes' ) ) {
    436441                return;
     442        }
    437443
    438444        $themes = get_site_transient( 'update_themes' );
    439445        if ( isset($themes->response) && is_array($themes->response) ) {