WordPress.org

Make WordPress Core

Changeset 21874


Ignore:
Timestamp:
09/16/2012 08:51:51 PM (6 years ago)
Author:
nacin
Message:

Add a filter to wp_get_update_data. props usermrpapa, SergeyBiryukov. fixes #17838.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/update.php

    r21105 r21874  
    353353
    354354    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'];
    355     $update_title = array();
     355    $titles = array();
    356356    if ( $counts['wordpress'] )
    357         $update_title[] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
     357        $titles['wordpress'] = sprintf( __( '%d WordPress Update'), $counts['wordpress'] );
    358358    if ( $counts['plugins'] )
    359         $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
     359        $titles['plugins'] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $counts['plugins'] ), $counts['plugins'] );
    360360    if ( $counts['themes'] )
    361         $update_title[] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    362 
    363     $update_title = ! empty( $update_title ) ? esc_attr( implode( ', ', $update_title ) ) : '';
    364 
    365     return array( 'counts' => $counts, 'title' => $update_title );
     361        $titles['themes'] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $counts['themes'] ), $counts['themes'] );
     362
     363    $update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';
     364
     365    return apply_filters( 'wp_get_update_data', array( 'counts' => $counts, 'title' => $update_title ), $titles );
    366366}
    367367
Note: See TracChangeset for help on using the changeset viewer.