Ticket #25158: 25158.2.diff
File 25158.2.diff, 20.1 KB (added by , 11 years ago) |
---|
-
src/wp-admin/admin-header.php
12 12 13 13 // In case admin-header.php is included in a function. 14 14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, 15 $ current_site, $update_title, $total_update_count, $parent_file;15 $update_title, $total_update_count, $parent_file; 16 16 17 $current_site = get_current_site(); 18 17 19 // Catch plugins that include admin-header.php before admin.php completes. 18 20 if ( empty( $current_screen ) ) 19 21 set_current_screen(); -
src/wp-admin/includes/class-wp-ms-sites-list-table.php
21 21 } 22 22 23 23 function prepare_items() { 24 global $s, $mode, $wpdb , $current_site;24 global $s, $mode, $wpdb; 25 25 26 $current_site = get_current_site(); 27 26 28 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode']; 27 29 28 30 $per_page = $this->get_items_per_page( 'sites_network_per_page' ); … … 168 170 } 169 171 170 172 function display_rows() { 171 global $ current_site, $mode;173 global $mode; 172 174 173 175 $status_list = array( 174 176 'archived' => array( 'site-archived', __( 'Archived' ) ), … … 202 204 } 203 205 echo "<tr class='$class'>"; 204 206 205 $blogname = ( is_subdomain_install() ) ? str_replace( '.' .$current_site->domain, '', $blog['domain'] ) : $blog['path'];207 $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path']; 206 208 207 209 list( $columns, $hidden ) = $this->get_column_info(); 208 210 … … 251 253 252 254 $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>'; 253 255 $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>'; 254 if ( $current_site->blog_id != $blog['blog_id'] ) {256 if ( get_current_site()->blog_id != $blog['blog_id'] ) { 255 257 if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' ) 256 258 $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>'; 257 259 else -
src/wp-admin/includes/class-wp-ms-users-list-table.php
133 133 } 134 134 135 135 function display_rows() { 136 global $ current_site, $mode;136 global $mode; 137 137 138 138 $alt = ''; 139 139 $super_admins = get_super_admins(); … … 223 223 224 224 $path = ( $val->path == '/' ) ? '' : $val->path; 225 225 echo '<span class="site-' . $val->site_id . '" >'; 226 echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';226 echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>'; 227 227 echo ' <small class="row-actions">'; 228 228 $actions = array(); 229 229 $actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>'; -
src/wp-admin/includes/ms.php
52 52 * @return void 53 53 */ 54 54 function wpmu_delete_blog( $blog_id, $drop = false ) { 55 global $wpdb , $current_site;55 global $wpdb; 56 56 57 57 $switch = false; 58 58 if ( get_current_blog_id() != $blog_id ) { … … 76 76 update_blog_status( $blog_id, 'deleted', 1 ); 77 77 78 78 // Don't destroy the initial, main, or root blog. 79 if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_site->path && $blog->domain == $current_site->domain ) ) )79 if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == get_current_site()->path && $blog->domain == get_current_site()->domain ) ) ) 80 80 $drop = false; 81 81 82 82 if ( $drop ) { -
src/wp-admin/includes/schema.php
323 323 * @uses $wp_db_version 324 324 */ 325 325 function populate_options() { 326 global $wpdb, $wp_db_version, $ current_site, $wp_current_db_version;326 global $wpdb, $wp_db_version, $wp_current_db_version; 327 327 328 328 $guessurl = wp_guess_url(); 329 329 … … 487 487 // 3.0 multisite 488 488 if ( is_multisite() ) { 489 489 /* translators: blog tagline */ 490 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site->site_name );490 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), get_current_site()->site_name ); 491 491 $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/'; 492 492 } 493 493 -
src/wp-admin/includes/upgrade.php
100 100 * 101 101 * @param int $user_id User ID. 102 102 */ 103 function wp_install_defaults( $user_id) {104 global $wpdb, $wp_rewrite, $ current_site, $table_prefix;103 function wp_install_defaults( $user_id ) { 104 global $wpdb, $wp_rewrite, $table_prefix; 105 105 106 106 // Default category 107 107 $cat_name = __('Uncategorized'); … … 135 135 $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ); 136 136 137 137 $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post ); 138 $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );138 $first_post = str_replace( "SITE_NAME", get_current_site()->site_name, $first_post ); 139 139 } else { 140 140 $first_post = __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'); 141 141 } -
src/wp-includes/admin-bar.php
216 216 * @param WP_Admin_Bar $wp_admin_bar 217 217 */ 218 218 function wp_admin_bar_site_menu( $wp_admin_bar ) { 219 global $current_site;220 221 219 // Don't show for logged out users. 222 220 if ( ! is_user_logged_in() ) 223 221 return; … … 232 230 $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() ); 233 231 234 232 if ( is_network_admin() ) { 235 $blogname = sprintf( __('Network Admin: %s'), esc_html( $current_site->site_name ) );233 $blogname = sprintf( __('Network Admin: %s'), esc_html( get_current_site()->site_name ) ); 236 234 } elseif ( is_user_admin() ) { 237 $blogname = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );235 $blogname = sprintf( __('Global Dashboard: %s'), esc_html( get_current_site()->site_name ) ); 238 236 } 239 237 240 238 $title = wp_html_excerpt( $blogname, 40, '…' ); -
src/wp-includes/class-wp-xmlrpc-server.php
459 459 * - 'xmlrpc' - url of xmlrpc endpoint 460 460 */ 461 461 function wp_getUsersBlogs( $args ) { 462 global $current_site;463 462 // If this isn't on WPMU then just use blogger_getUsersBlogs 464 463 if ( !is_multisite() ) { 465 464 array_unshift( $args, 1 ); … … 481 480 482 481 foreach ( $blogs as $blog ) { 483 482 // Don't include blogs that aren't hosted at this site 484 if ( $blog->site_id != $current_site->id )483 if ( $blog->site_id != get_current_site()->id ) 485 484 continue; 486 485 487 486 $blog_id = $blog->userblog_id; -
src/wp-includes/http.php
506 506 * @return bool 507 507 */ 508 508 function ms_allowed_http_request_hosts( $is_external, $host ) { 509 global $wpdb , $current_site;509 global $wpdb; 510 510 static $queried = array(); 511 511 if ( $is_external ) 512 512 return $is_external; 513 if ( $host === $current_site->domain )513 if ( $host === get_current_site()->domain ) 514 514 return true; 515 515 if ( isset( $queried[ $host ] ) ) 516 516 return $queried[ $host ]; -
src/wp-includes/link-template.php
2104 2104 * @return string Site url link with optional path appended. 2105 2105 */ 2106 2106 function network_site_url( $path = '', $scheme = null ) { 2107 global $current_site;2108 2109 2107 if ( ! is_multisite() ) 2110 2108 return site_url($path, $scheme); 2111 2109 2112 2110 if ( 'relative' == $scheme ) 2113 $url = $current_site->path;2111 $url = get_current_site()->path; 2114 2112 else 2115 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );2113 $url = set_url_scheme( 'http://' . get_current_site()->domain . get_current_site()->path, $scheme ); 2116 2114 2117 2115 if ( $path && is_string( $path ) ) 2118 2116 $url .= ltrim( $path, '/' ); … … 2135 2133 * @return string Home url link with optional path appended. 2136 2134 */ 2137 2135 function network_home_url( $path = '', $scheme = null ) { 2138 global $current_site;2139 2140 2136 if ( ! is_multisite() ) 2141 2137 return home_url($path, $scheme); 2142 2138 … … 2146 2142 $scheme = is_ssl() && ! is_admin() ? 'https' : 'http'; 2147 2143 2148 2144 if ( 'relative' == $scheme ) 2149 $url = $current_site->path;2145 $url = get_current_site()->path; 2150 2146 else 2151 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );2147 $url = set_url_scheme( 'http://' . get_current_site()->domain . get_current_site()->path, $scheme ); 2152 2148 2153 2149 if ( $path && is_string( $path ) ) 2154 2150 $url .= ltrim( $path, '/' ); -
src/wp-includes/ms-blogs.php
90 90 * @return int A blog id 91 91 */ 92 92 function get_id_from_blogname( $slug ) { 93 global $wpdb , $current_site;93 global $wpdb; 94 94 95 $current_site = get_current_site(); 95 96 $slug = trim( $slug, '/' ); 96 97 97 98 $blog_id = wp_cache_get( 'get_id_from_blogname_' . $slug, 'blog-details' ); -
src/wp-includes/ms-default-constants.php
45 45 * @since 3.0.0 46 46 */ 47 47 function ms_cookie_constants( ) { 48 global $current_site;48 $current_site = get_current_site(); 49 49 50 50 /** 51 51 * @since 1.2.0 -
src/wp-includes/ms-functions.php
532 532 * @param string $blog_title The blog title provided by the user. 533 533 * @return array Contains the new site data and error messages. 534 534 */ 535 function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '') {536 global $wpdb, $domain , $current_site;535 function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { 536 global $wpdb, $domain; 537 537 538 $current_site = get_current_site(); 538 539 $base = $current_site->path; 539 540 540 541 $blog_title = strip_tags( $blog_title ); … … 705 706 * @param string $key The activation key created in wpmu_signup_blog() 706 707 * @return bool 707 708 */ 708 function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta = '') { 709 global $current_site; 710 709 function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = '' ) { 711 710 if ( !apply_filters('wpmu_signup_blog_notification', $domain, $path, $title, $user, $user_email, $key, $meta) ) 712 711 return false; 713 712 714 713 // Send email with activation link. 715 if ( !is_subdomain_install() || $current_site->id != 1 )714 if ( !is_subdomain_install() || get_current_site()->id != 1 ) 716 715 $activate_url = network_site_url("wp-activate.php?key=$key"); 717 716 else 718 717 $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API … … 1118 1117 * @param int $blog_id The value returned by insert_blog(). 1119 1118 * @param string $blog_title The title of the new site. 1120 1119 */ 1121 function install_blog( $blog_id, $blog_title = '') {1122 global $wpdb, $wp_roles , $current_site;1120 function install_blog( $blog_id, $blog_title = '' ) { 1121 global $wpdb, $wp_roles; 1123 1122 1124 1123 // Cast for security 1125 1124 $blog_id = (int) $blog_id; … … 1147 1146 if ( get_site_option( 'ms_files_rewriting' ) ) 1148 1147 update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" ); 1149 1148 else 1150 update_option( 'upload_path', get_blog_option( $current_site->blog_id, 'upload_path' ) );1149 update_option( 'upload_path', get_blog_option( get_current_site()->blog_id, 'upload_path' ) ); 1151 1150 1152 1151 update_option( 'blogname', wp_unslash( $blog_title ) ); 1153 1152 update_option( 'admin_email', '' ); … … 1200 1199 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1201 1200 * @return bool 1202 1201 */ 1203 function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = '') {1204 global $current_site;1202 function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = '' ) { 1203 $current_site = get_current_site(); 1205 1204 1206 1205 if ( !apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta) ) 1207 1206 return false; … … 1264 1263 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1265 1264 * @return bool 1266 1265 */ 1267 function wpmu_welcome_user_notification( $user_id, $password, $meta = '') {1268 global $current_site;1266 function wpmu_welcome_user_notification( $user_id, $password, $meta = '' ) { 1267 $current_site = get_current_site(); 1269 1268 1270 1269 if ( !apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta) ) 1271 1270 return false; … … 1553 1552 * @return array The current site's domain 1554 1553 */ 1555 1554 function redirect_this_site( $deprecated = '' ) { 1556 global $current_site; 1557 return array( $current_site->domain ); 1555 return array( get_current_site()->domain ); 1558 1556 } 1559 1557 1560 1558 /** … … 1682 1680 * @param array $meta 1683 1681 */ 1684 1682 function add_new_user_to_blog( $user_id, $password, $meta ) { 1685 global $current_site;1686 1683 if ( !empty( $meta[ 'add_to_blog' ] ) ) { 1687 1684 $blog_id = $meta[ 'add_to_blog' ]; 1688 1685 $role = $meta[ 'new_role' ]; 1689 remove_user_from_blog($user_id, $current_site->blog_id); // remove user from main blog.1686 remove_user_from_blog($user_id, get_current_site()->blog_id); // remove user from main blog. 1690 1687 add_user_to_blog( $blog_id, $user_id, $role ); 1691 1688 update_user_meta( $user_id, 'primary_blog', $blog_id ); 1692 1689 } … … 1698 1695 * @since MU 1699 1696 */ 1700 1697 function fix_phpmailer_messageid( $phpmailer ) { 1701 global $current_site; 1702 $phpmailer->Hostname = $current_site->domain; 1698 $phpmailer->Hostname = get_current_site()->domain; 1703 1699 } 1704 1700 1705 1701 /** -
src/wp-includes/ms-load.php
69 69 * @return bool|string Returns true on success, or drop-in file to include. 70 70 */ 71 71 function ms_site_check() { 72 global $wpdb, $current_site;73 74 72 $blog = get_blog_details(); 75 73 76 74 // Allow short-circuiting … … 93 91 if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) 94 92 return WP_CONTENT_DIR . '/blog-inactive.php'; 95 93 else 96 wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}") ) ) );94 wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', 'support@' . get_current_site()->domain ) ) ) ); 97 95 } 98 96 99 97 if ( $blog->archived == '1' || $blog->spam == '1' ) { -
src/wp-login.php
38 38 * @param string $message Optional. Message to display in header. 39 39 * @param WP_Error $wp_error Optional. WordPress Error Object 40 40 */ 41 function login_header( $title = 'Log In', $message = '', $wp_error = '') {42 global $error, $interim_login, $ current_site, $action;41 function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { 42 global $error, $interim_login, $action; 43 43 44 44 // Don't index any of these forms 45 45 add_action( 'login_head', 'wp_no_robots' ); … … 82 82 83 83 if ( is_multisite() ) { 84 84 $login_header_url = network_home_url(); 85 $login_header_title = $current_site->site_name;85 $login_header_title = get_current_site()->site_name; 86 86 } else { 87 87 $login_header_url = __( 'http://wordpress.org/' ); 88 88 $login_header_title = __( 'Powered by WordPress' ); … … 197 197 * @return bool|WP_Error True: when finish. WP_Error on error 198 198 */ 199 199 function retrieve_password() { 200 global $wpdb , $current_site;200 global $wpdb; 201 201 202 202 $errors = new WP_Error(); 203 203 -
src/wp-signup.php
77 77 * @param string $blog_title The new site title 78 78 * @param array $errors 79 79 */ 80 function show_blog_form( $blogname = '', $blog_title = '', $errors = '') {81 global $current_site;80 function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { 81 $current_site = get_current_site(); 82 82 // Blog name 83 83 if ( !is_subdomain_install() ) 84 84 echo '<label for="blogname">' . __('Site Name:') . '</label>'; … … 201 201 * @param string $blog_title The new blog title 202 202 * @param array $errors 203 203 */ 204 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { 205 global $current_site; 204 function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { 206 205 $current_user = wp_get_current_user(); 207 206 208 207 if ( ! is_wp_error($errors) ) { … … 215 214 $blog_title = $filtered_results['blog_title']; 216 215 $errors = $filtered_results['errors']; 217 216 218 echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), $current_site->site_name ) . '</h2>';217 echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_current_site()->site_name ) . '</h2>'; 219 218 220 219 if ( $errors->get_error_code() ) { 221 220 echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>'; … … 311 310 * @param string $user_email The user's email 312 311 * @param array $errors 313 312 */ 314 function signup_user( $user_name = '', $user_email = '', $errors = '') {315 global $ current_site, $active_signup;313 function signup_user( $user_name = '', $user_email = '', $errors = '' ) { 314 global $active_signup; 316 315 317 316 if ( !is_wp_error($errors) ) 318 317 $errors = new WP_Error(); … … 327 326 328 327 ?> 329 328 330 <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2>329 <h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2> 331 330 <form id="setupform" method="post" action="wp-signup.php"> 332 331 <input type="hidden" name="stage" value="validate-user-signup" /> 333 332 <?php do_action( 'signup_hidden_fields' ); ?>