site_admin_notice

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

WordPress Version: 6.4

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow       The filename of the current screen.
 *
 * @return void|false Void on success. False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' === $pagenow) {
        return;
    }
    if ((int) get_site_option('wpmu_upgrade_site') !== $wp_db_version) {
        $upgrade_network_message = sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        );
        wp_admin_notice($upgrade_network_message, array('type' => 'warning', 'additional_classes' => array('update-nag', 'inline'), 'paragraph_wrap' => false));
    }
}

WordPress Version: 6.1

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow       The filename of the current screen.
 *
 * @return void|false Void on success. False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' === $pagenow) {
        return;
    }
    if ((int) get_site_option('wpmu_upgrade_site') !== $wp_db_version) {
        echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        ) . '</div>';
    }
}

WordPress Version: 5.9

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow
 *
 * @return void|false Void on success. False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' === $pagenow) {
        return;
    }
    if ((int) get_site_option('wpmu_upgrade_site') !== $wp_db_version) {
        echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        ) . '</div>';
    }
}

WordPress Version: 5.7

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow
 *
 * @return void|false Void on success. False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' === $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        ) . '</div>';
    }
}

WordPress Version: 5.5

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' === $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        ) . '</div>';
    }
}

WordPress Version: 5.3

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version WordPress database version.
 * @global string $pagenow
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' == $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'),
            esc_url(network_admin_url('upgrade.php'))
        ) . '</div>';
    }
}

WordPress Version: 5.1

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version The version number of the database.
 * @global string $pagenow
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' == $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . '</div>';
    }
}

WordPress Version: 4.8

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version The version number of the database.
 * @global string $pagenow
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!current_user_can('upgrade_network')) {
        return false;
    }
    if ('upgrade.php' == $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . "</div>";
    }
}

WordPress Version: 4.5

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int    $wp_db_version The version number of the database.
 * @global string $pagenow
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version, $pagenow;
    if (!is_super_admin()) {
        return false;
    }
    if ('upgrade.php' == $pagenow) {
        return;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . "</div>";
    }
}

WordPress Version: 4.3

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int $wp_db_version The version number of the database.
 *
 * @return false False if the current user is not a super admin.
 */
function site_admin_notice()
{
    global $wp_db_version;
    if (!is_super_admin()) {
        return false;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . "</div>";
    }
}

WordPress Version: 4.1

/**
 * Displays an admin notice to upgrade all sites after a core upgrade.
 *
 * @since 3.0.0
 *
 * @global int $wp_db_version The version number of the database.
 */
function site_admin_notice()
{
    global $wp_db_version;
    if (!is_super_admin()) {
        return false;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . "</div>";
    }
}

WordPress Version: 3.7

function site_admin_notice()
{
    global $wp_db_version;
    if (!is_super_admin()) {
        return false;
    }
    if (get_site_option('wpmu_upgrade_site') != $wp_db_version) {
        echo "<div class='update-nag'>" . sprintf(__('Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.'), esc_url(network_admin_url('upgrade.php'))) . "</div>";
    }
}