_access_denied_splash

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

WordPress Version: 5.3

/**
 * Displays an access denied message when a user tries to view a site's dashboard they
 * do not have access to.
 *
 * @since 3.2.0
 * @access private
 */
function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (wp_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        wp_die(sprintf(
            /* translators: 1: Site title. */
            __('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'),
            $blog_name
        ), 403);
    }
    $output = '<p>' . sprintf(
        /* translators: 1: Site title. */
        __('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'),
        $blog_name
    ) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= '<tr>';
        $output .= "<td>{$blog->blogname}</td>";
        $output .= '<td><a href="' . esc_url(get_admin_url($blog->userblog_id)) . '">' . __('Visit Dashboard') . '</a> | ' . '<a href="' . esc_url(get_home_url($blog->userblog_id)) . '">' . __('View Site') . '</a></td>';
        $output .= '</tr>';
    }
    $output .= '</table>';
    wp_die($output, 403);
}

WordPress Version: 4.2

/**
 * Displays an access denied message when a user tries to view a site's dashboard they
 * do not have access to.
 *
 * @since 3.2.0
 * @access private
 */
function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (wp_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        wp_die(sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name), 403);
    }
    $output = '<p>' . sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= '<tr>';
        $output .= "<td>{$blog->blogname}</td>";
        $output .= '<td><a href="' . esc_url(get_admin_url($blog->userblog_id)) . '">' . __('Visit Dashboard') . '</a> | ' . '<a href="' . esc_url(get_home_url($blog->userblog_id)) . '">' . __('View Site') . '</a></td>';
        $output .= '</tr>';
    }
    $output .= '</table>';
    wp_die($output, 403);
}

WordPress Version: 4.1

/**
 * Displays an access denied message when a user tries to view a site's dashboard they
 * do not have access to.
 *
 * @since 3.2.0
 * @access private
 */
function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (wp_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        wp_die(sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name));
    }
    $output = '<p>' . sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= '<tr>';
        $output .= "<td>{$blog->blogname}</td>";
        $output .= '<td><a href="' . esc_url(get_admin_url($blog->userblog_id)) . '">' . __('Visit Dashboard') . '</a> | ' . '<a href="' . esc_url(get_home_url($blog->userblog_id)) . '">' . __('View Site') . '</a></td>';
        $output .= '</tr>';
    }
    $output .= '</table>';
    wp_die($output);
}

WordPress Version: 3.9

function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (wp_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        wp_die(sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name));
    }
    $output = '<p>' . sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= '<tr>';
        $output .= "<td>{$blog->blogname}</td>";
        $output .= '<td><a href="' . esc_url(get_admin_url($blog->userblog_id)) . '">' . __('Visit Dashboard') . '</a> | ' . '<a href="' . esc_url(get_home_url($blog->userblog_id)) . '">' . __('View Site') . '</a></td>';
        $output .= '</tr>';
    }
    $output .= '</table>';
    wp_die($output);
}

WordPress Version: 3.7

function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (wp_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        wp_die(sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name));
    }
    $output = '<p>' . sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= "<tr>";
        $output .= "<td valign='top'>";
        $output .= "{$blog->blogname}";
        $output .= "</td>";
        $output .= "<td valign='top'>";
        $output .= "<a href='" . esc_url(get_admin_url($blog->userblog_id)) . "'>" . __('Visit Dashboard') . "</a> | <a href='" . esc_url(get_home_url($blog->userblog_id)) . "'>" . __('View Site') . "</a>";
        $output .= "</td>";
        $output .= "</tr>";
    }
    $output .= '</table>';
    wp_die($output);
}