admin.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * WordPress Network Administration Bootstrap
  4. *
  5. * @package WordPress
  6. * @subpackage Multisite
  7. * @since 3.1.0
  8. */
  9. define( 'WP_NETWORK_ADMIN', true );
  10. /** Load WordPress Administration Bootstrap */
  11. require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
  12. // Do not remove this check. It is required by individual network admin pages.
  13. if ( ! is_multisite() ) {
  14. wp_die( __( 'Multisite support is not enabled.' ) );
  15. }
  16. $redirect_network_admin_request = 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path );
  17. /**
  18. * Filters whether to redirect the request to the Network Admin.
  19. *
  20. * @since 3.2.0
  21. *
  22. * @param bool $redirect_network_admin_request Whether the request should be redirected.
  23. */
  24. $redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );
  25. if ( $redirect_network_admin_request ) {
  26. wp_redirect( network_admin_url() );
  27. exit;
  28. }
  29. unset( $redirect_network_admin_request );