wp_get_update_data

The timeline below displays how wordpress function wp_get_update_data has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Collects counts and UI strings for available updates.
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    $plugins = current_user_can('update_plugins');
    if ($plugins) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    $themes = current_user_can('update_themes');
    if ($themes) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    $core = current_user_can('update_core');
    if ($core && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest'), true) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        /* translators: %d: Number of available WordPress updates. */
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        /* translators: %d: Number of available plugin updates. */
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        /* translators: %d: Number of available theme updates. */
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 5.5

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    $plugins = current_user_can('update_plugins');
    if ($plugins) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    $themes = current_user_can('update_themes');
    if ($themes) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    $core = current_user_can('update_core');
    if ($core && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest'), true) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        /* translators: %d: Number of available WordPress updates. */
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        /* translators: %d: Number of available plugin updates. */
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        /* translators: %d: Number of available theme updates. */
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 5.3

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    $plugins = current_user_can('update_plugins');
    if ($plugins) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    $themes = current_user_can('update_themes');
    if ($themes) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    $core = current_user_can('update_core');
    if ($core && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        /* translators: %d: Number of available WordPress updates. */
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        /* translators: %d: Number of available plugin updates. */
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        /* translators: %d: Number of available theme updates. */
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 5.1

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        /* translators: %d: number of updates available to WordPress */
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        /* translators: %d: number of updates available to plugins */
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        /* translators: %d: number of updates available to themes */
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 4.7

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        /* translators: 1: Number of updates available to WordPress */
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        /* translators: 1: Number of updates available to plugins */
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        /* translators: 1: Number of updates available to themes */
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 4.6

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filters the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 1.1

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filter the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 4.1

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        wp_update_plugins();
        // Check for Plugin updates
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        wp_update_themes();
        // Check for Theme updates
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filter the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 3.8

/**
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filter the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}

WordPress Version: 3.7

/*
 * Collect counts and UI strings for available updates
 *
 * @since 3.3.0
 *
 * @return array
 */
function wp_get_update_data()
{
    $counts = array('plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0);
    if ($plugins = current_user_can('update_plugins')) {
        $update_plugins = get_site_transient('update_plugins');
        if (!empty($update_plugins->response)) {
            $counts['plugins'] = count($update_plugins->response);
        }
    }
    if ($themes = current_user_can('update_themes')) {
        $update_themes = get_site_transient('update_themes');
        if (!empty($update_themes->response)) {
            $counts['themes'] = count($update_themes->response);
        }
    }
    if (($core = current_user_can('update_core')) && function_exists('get_core_updates')) {
        $update_wordpress = get_core_updates(array('dismissed' => false));
        if (!empty($update_wordpress) && !in_array($update_wordpress[0]->response, array('development', 'latest')) && current_user_can('update_core')) {
            $counts['wordpress'] = 1;
        }
    }
    if (($core || $plugins || $themes) && wp_get_translation_updates()) {
        $counts['translations'] = 1;
    }
    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles = array();
    if ($counts['wordpress']) {
        $titles['wordpress'] = sprintf(__('%d WordPress Update'), $counts['wordpress']);
    }
    if ($counts['plugins']) {
        $titles['plugins'] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $counts['plugins']), $counts['plugins']);
    }
    if ($counts['themes']) {
        $titles['themes'] = sprintf(_n('%d Theme Update', '%d Theme Updates', $counts['themes']), $counts['themes']);
    }
    if ($counts['translations']) {
        $titles['translations'] = __('Translation Updates');
    }
    $update_title = $titles ? esc_attr(implode(', ', $titles)) : '';
    $update_data = array('counts' => $counts, 'title' => $update_title);
    /**
     * Filter the returned array of update data for plugins, themes, and WordPress core.
     *
     * @since 3.5.0
     *
     * @param array $update_data {
     *     Fetched update data.
     *
     *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.
     *     @type string  $update_title Titles of available updates.
     * }
     * @param array $titles An array of update counts and UI strings for available updates.
     */
    return apply_filters('wp_get_update_data', $update_data, $titles);
}