1 | <?php |
---|
2 | /* Plugin Name: Ticket 17090 |
---|
3 | * Plugin URL: http://core.trac.wordpress.org/ticket/17090 |
---|
4 | */ |
---|
5 | |
---|
6 | if ( isset( $_GET['debug'] ) ) |
---|
7 | add_action( 'admin_init', 'debug_ticket_17090' ); |
---|
8 | function debug_ticket_17090() { |
---|
9 | global $current_site, $current_blog, $wpdb; |
---|
10 | echo '<pre>'; |
---|
11 | echo "Attempted URL: " . $_SERVER['HTTP_HOST'] . remove_query_arg( 'debug', $_SERVER['REQUEST_URI'] ) . "\n"; |
---|
12 | echo "Network admin: " . ( is_network_admin() ? 'true' : 'false' ) . "\n"; |
---|
13 | echo "Main site: " . ( is_main_site() ? 'true' : 'false' ) . "\n"; |
---|
14 | echo "Network admin URL: " . network_admin_url() . "\n"; |
---|
15 | print_r( $current_site ); |
---|
16 | print_r( $current_blog ); |
---|
17 | print_r( $wpdb->get_row( "SELECT * FROM $wpdb->blogs WHERE blog_id = 1" ) ); |
---|
18 | print_r( $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE site_id = 1" ) ); |
---|
19 | foreach ( array( 'DOMAIN_CURRENT_SITE', 'PATH_CURRENT_SITE', 'SITE_ID_CURRENT_SITE', 'BLOG_ID_CURRENT_SITE', 'BLOGID_CURRENT_SITE' ) as $constant ) { |
---|
20 | if ( defined( $constant ) ) |
---|
21 | echo "$constant is " . constant( $constant ) . "\n"; |
---|
22 | } |
---|
23 | echo '</pre>'; |
---|
24 | die(); |
---|
25 | } |
---|