6 * @subpackage Multisite |
6 * @subpackage Multisite |
7 * @since 3.1.0 |
7 * @since 3.1.0 |
8 */ |
8 */ |
9 |
9 |
10 /** Load WordPress Administration Bootstrap */ |
10 /** Load WordPress Administration Bootstrap */ |
11 require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 require_once __DIR__ . '/admin.php'; |
12 |
12 |
13 if ( ! current_user_can( 'manage_sites' ) ) { |
13 if ( ! current_user_can( 'manage_sites' ) ) { |
14 wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) ); |
14 wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) ); |
15 } |
15 } |
16 |
16 |
134 * @param string $redirect_url The redirect URL. |
134 * @param string $redirect_url The redirect URL. |
135 * @param string $action The action being taken. |
135 * @param string $action The action being taken. |
136 * @param array $items The items to take the action on. |
136 * @param array $items The items to take the action on. |
137 * @param int $site_id The site ID. |
137 * @param int $site_id The site ID. |
138 */ |
138 */ |
139 $referer = apply_filters( "handle_network_bulk_actions-{$screen}", $referer, $action, $themes, $id ); |
139 $referer = apply_filters( "handle_network_bulk_actions-{$screen}", $referer, $action, $themes, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
140 } else { |
140 } else { |
141 $action = 'error'; |
141 $action = 'error'; |
142 $n = 'none'; |
142 $n = 'none'; |
143 } |
143 } |
144 } |
144 } |
156 ) |
156 ) |
157 ); |
157 ); |
158 exit; |
158 exit; |
159 } |
159 } |
160 |
160 |
161 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { |
161 if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) { |
162 wp_safe_redirect( $referer ); |
162 wp_safe_redirect( $referer ); |
163 exit(); |
163 exit; |
164 } |
164 } |
165 |
165 |
166 add_thickbox(); |
166 add_thickbox(); |
167 add_screen_option( 'per_page' ); |
167 add_screen_option( 'per_page' ); |
168 |
168 |
169 /* translators: %s: site name */ |
169 /* translators: %s: Site title. */ |
170 $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
170 $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
171 |
171 |
172 $parent_file = 'sites.php'; |
172 $parent_file = 'sites.php'; |
173 $submenu_file = 'sites.php'; |
173 $submenu_file = 'sites.php'; |
174 |
174 |
175 require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
175 require_once ABSPATH . 'wp-admin/admin-header.php'; ?> |
176 |
176 |
177 <div class="wrap"> |
177 <div class="wrap"> |
178 <h1 id="edit-site"><?php echo $title; ?></h1> |
178 <h1 id="edit-site"><?php echo $title; ?></h1> |
179 <p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p> |
179 <p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p> |
180 <?php |
180 <?php |
186 ) |
186 ) |
187 ); |
187 ); |
188 |
188 |
189 if ( isset( $_GET['enabled'] ) ) { |
189 if ( isset( $_GET['enabled'] ) ) { |
190 $enabled = absint( $_GET['enabled'] ); |
190 $enabled = absint( $_GET['enabled'] ); |
191 if ( 1 == $enabled ) { |
191 if ( 1 === $enabled ) { |
192 $message = __( 'Theme enabled.' ); |
192 $message = __( 'Theme enabled.' ); |
193 } else { |
193 } else { |
|
194 /* translators: %s: Number of themes. */ |
194 $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled ); |
195 $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled ); |
195 } |
196 } |
196 echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; |
197 echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; |
197 } elseif ( isset( $_GET['disabled'] ) ) { |
198 } elseif ( isset( $_GET['disabled'] ) ) { |
198 $disabled = absint( $_GET['disabled'] ); |
199 $disabled = absint( $_GET['disabled'] ); |
199 if ( 1 == $disabled ) { |
200 if ( 1 === $disabled ) { |
200 $message = __( 'Theme disabled.' ); |
201 $message = __( 'Theme disabled.' ); |
201 } else { |
202 } else { |
|
203 /* translators: %s: Number of themes. */ |
202 $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); |
204 $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); |
203 } |
205 } |
204 echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; |
206 echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; |
205 } elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) { |
207 } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) { |
206 echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; |
208 echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; |
207 } |
209 } |
208 ?> |
210 ?> |
209 |
211 |
210 <p><?php _e( 'Network enabled themes are not shown on this screen.' ); ?></p> |
212 <p><?php _e( 'Network enabled themes are not shown on this screen.' ); ?></p> |