_access_denied_splash

Displays an access denied message when a user tries to view a site's dashboard they do not have access to.

Description

_access_denied_splash(); 

Usage

  1. if ( !function_exists( '_access_denied_splash' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ms.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _access_denied_splash(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/ms.php  
  1. function _access_denied_splash() { 
  2. return; 
  3.  
  4.  
  5. if ( wp_list_filter( $blogs, array( 'userblog_id' => get_current_blog_id() ) ) ) 
  6. return; 
  7.  
  8. $blog_name = get_bloginfo( 'name' ); 
  9.  
  10. if ( empty( $blogs ) ) 
  11. 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 ); 
  12.  
  13. $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>'; 
  14. $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>'; 
  15.  
  16. $output .= '<h3>' . __('Your Sites') . '</h3>'; 
  17. $output .= '<table>'; 
  18.  
  19. foreach ( $blogs as $blog ) { 
  20. $output .= '<tr>'; 
  21. $output .= "<td>{$blog->blogname}</td>"; 
  22. $output .= '<td><a href="' . esc_url( get_admin_url( $blog->userblog_id ) ) . '">' . __( 'Visit Dashboard' ) . '</a> | ' . 
  23. '<a href="' . esc_url( get_home_url( $blog->userblog_id ) ). '">' . __( 'View Site' ) . '</a></td>'; 
  24. $output .= '</tr>'; 
  25.  
  26. $output .= '</table>'; 
  27.  
  28. wp_die( $output, 403 );