Changeset 56599 for trunk/src/wp-admin/includes/network.php
- Timestamp:
- 09/17/2023 03:21:07 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/network.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/network.php
r56410 r56599 114 114 115 115 if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { 116 echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . sprintf( 116 $cannot_define_constant_message = '<strong>' . __( 'Error:' ) . '</strong> '; 117 $cannot_define_constant_message .= sprintf( 117 118 /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */ 118 119 __( 'The constant %s cannot be defined when creating a network.' ), 119 120 '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>' 120 ) . '</p></div>'; 121 ); 122 123 wp_admin_notice( 124 $cannot_define_constant_message, 125 array( 126 'additional_classes' => array( 'error' ), 127 ) 128 ); 129 121 130 echo '</div>'; 122 131 require_once ABSPATH . 'wp-admin/admin-footer.php'; … … 143 152 $has_ports = strstr( $hostname, ':' ); 144 153 if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ), true ) ) ) { 145 echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>'; 154 wp_admin_notice( 155 '<strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ), 156 array( 157 'additional_classes' => array( 'error' ), 158 ) 159 ); 160 146 161 echo '<p>' . sprintf( 147 162 /* translators: %s: Port number. */ … … 161 176 $error_codes = array(); 162 177 if ( is_wp_error( $errors ) ) { 163 echo '<div class="error"><p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>';178 $network_created_error_message = '<p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>'; 164 179 foreach ( $errors->get_error_messages() as $error ) { 165 echo "<p>$error</p>"; 166 } 167 echo '</div>'; 180 $network_created_error_message .= "<p>$error</p>"; 181 } 182 wp_admin_notice( 183 $network_created_error_message, 184 array( 185 'additional_classes' => array( 'error' ), 186 'paragraph_wrap' => false, 187 ) 188 ); 168 189 $error_codes = $errors->get_error_codes(); 169 190 } … … 196 217 $got_mod_rewrite = got_mod_rewrite(); 197 218 if ( $got_mod_rewrite ) { // Dangerous assumptions. 198 echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> '; 199 printf( 219 $message_class = 'updated'; 220 $message = '<p><strong>' . __( 'Warning:' ) . '</strong> '; 221 $message .= '<p>' . sprintf( 200 222 /* translators: %s: mod_rewrite */ 201 223 __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ), 202 224 '<code>mod_rewrite</code>' 203 ); 204 echo '</p>'; 225 ) . '</p>'; 205 226 } elseif ( $is_apache ) { 206 echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> '; 207 printf( 227 $message_class = 'error'; 228 $message = '<p><strong>' . __( 'Warning:' ) . '</strong> '; 229 $message .= sprintf( 208 230 /* translators: %s: mod_rewrite */ 209 231 __( 'It looks like the Apache %s module is not installed.' ), 210 232 '<code>mod_rewrite</code>' 211 ); 212 echo '</p>'; 233 ) . '</p>'; 213 234 } 214 235 215 236 if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache). 216 echo '<p>'; 217 printf( 237 $message .= '<p>' . sprintf( 218 238 /* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */ 219 239 __( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ), … … 221 241 'https://httpd.apache.org/docs/mod/mod_rewrite.html', 222 242 'https://www.google.com/search?q=apache+mod_rewrite' 243 ) . '</p>'; 244 245 wp_admin_notice( 246 $message, 247 array( 248 'additional_classes' => array( $message_class, 'inline' ), 249 'paragraph_wrap' => false, 250 ) 223 251 ); 224 echo '</p></div>';225 252 } 226 253 } … … 264 291 265 292 if ( WP_CONTENT_DIR !== ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) { 266 echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>'; 293 $subdirectory_warning_message = '<strong>' . __( 'Warning:' ) . '</strong> '; 294 $subdirectory_warning_message .= __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ); 295 wp_admin_notice( 296 $subdirectory_warning_message, 297 array( 298 'additional_classes' => array( 'error', 'inline' ), 299 ) 300 ); 267 301 } 268 302 … … 410 444 // Wildcard DNS message. 411 445 if ( is_wp_error( $errors ) ) { 412 echo '<div class="error">' . $errors->get_error_message() . '</div>'; 446 wp_admin_notice( 447 $errors->get_error_message(), 448 array( 449 'additional_classes' => array( 'error' ), 450 ) 451 ); 413 452 } 414 453 … … 427 466 } else { 428 467 $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); 468 469 wp_admin_notice( 470 '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'An existing WordPress network was detected.' ), 471 array( 472 'additional_classes' => array( 'error' ), 473 ) 474 ); 429 475 ?> 430 <div class="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>431 476 <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p> 432 477 <?php
Note: See TracChangeset
for help on using the changeset viewer.