wp/wp-admin/network/site-settings.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
   102 		'selected' => 'site-settings',
   102 		'selected' => 'site-settings',
   103 	)
   103 	)
   104 );
   104 );
   105 
   105 
   106 if ( ! empty( $messages ) ) {
   106 if ( ! empty( $messages ) ) {
       
   107 	$notice_args = array(
       
   108 		'type'        => 'success',
       
   109 		'dismissible' => true,
       
   110 		'id'          => 'message',
       
   111 	);
       
   112 
   107 	foreach ( $messages as $msg ) {
   113 	foreach ( $messages as $msg ) {
   108 		echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
   114 		wp_admin_notice( $msg, $notice_args );
   109 	}
   115 	}
   110 }
   116 }
   111 ?>
   117 ?>
   112 <form method="post" action="site-settings.php?action=update-site">
   118 <form method="post" action="site-settings.php?action=update-site">
   113 	<?php wp_nonce_field( 'edit-site' ); ?>
   119 	<?php wp_nonce_field( 'edit-site' ); ?>
   141 					$disabled             = true;
   147 					$disabled             = true;
   142 					$class                = 'all-options disabled';
   148 					$class                = 'all-options disabled';
   143 				}
   149 				}
   144 			}
   150 			}
   145 
   151 
   146 			if ( strpos( $option->option_value, "\n" ) !== false ) {
   152 			if ( str_contains( $option->option_value, "\n" ) ) {
   147 				?>
   153 				?>
   148 				<tr class="form-field">
   154 				<tr class="form-field">
   149 					<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo ucwords( str_replace( '_', ' ', $option->option_name ) ); ?></label></th>
   155 					<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th>
   150 					<td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>
   156 					<td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>
   151 				</tr>
   157 				</tr>
   152 				<?php
   158 				<?php
   153 			} else {
   159 			} else {
   154 				?>
   160 				?>
   155 				<tr class="form-field">
   161 				<tr class="form-field">
   156 					<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo esc_html( ucwords( str_replace( '_', ' ', $option->option_name ) ) ); ?></label></th>
   162 					<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th>
   157 					<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ), true ) ) { ?>
   163 					<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ), true ) ) { ?>
   158 					<td><code><?php echo esc_html( $option->option_value ); ?></code></td>
   164 					<td><code><?php echo esc_html( $option->option_value ); ?></code></td>
   159 					<?php } else { ?>
   165 					<?php } else { ?>
   160 					<td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td>
   166 					<td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td>
   161 					<?php } ?>
   167 					<?php } ?>