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

git-svn-id: http://core.svn.wordpress.org/trunk@21874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-16 20:51:51 +00:00
parent c8f160b6d8
commit 45472e9915
1 changed files with 6 additions and 6 deletions

View File

@ -352,17 +352,17 @@ function wp_get_update_data() {
}
$counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'];
$update_title = array();
$titles = array();
if ( $counts['wordpress'] )
$update_title[] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
$titles['wordpress'] = sprintf( __( '%d WordPress Update'), $counts['wordpress'] );
if ( $counts['plugins'] )
$update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
$titles['plugins'] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $counts['plugins'] ), $counts['plugins'] );
if ( $counts['themes'] )
$update_title[] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
$titles['themes'] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $counts['themes'] ), $counts['themes'] );
$update_title = ! empty( $update_title ) ? esc_attr( implode( ', ', $update_title ) ) : '';
$update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';
return array( 'counts' => $counts, 'title' => $update_title );
return apply_filters( 'wp_get_update_data', array( 'counts' => $counts, 'title' => $update_title ), $titles );
}
function _maybe_update_core() {