@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -require( ABSPATH . 'wp-admin/credits.php' ); |
|
16 | +require(ABSPATH.'wp-admin/credits.php'); |
@@ -10,7 +10,8 @@ |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | 17 | require( ABSPATH . 'wp-admin/credits.php' ); |
@@ -252,10 +252,10 @@ |
||
252 | 252 | |
253 | 253 | <?php |
254 | 254 | /** |
255 | - * Fires after the list table on the Users screen in the Multisite Network Admin. |
|
256 | - * |
|
257 | - * @since 3.1.0 |
|
258 | - */ |
|
255 | + * Fires after the list table on the Users screen in the Multisite Network Admin. |
|
256 | + * |
|
257 | + * @since 3.1.0 |
|
258 | + */ |
|
259 | 259 | do_action( 'network_site_users_after_list_table' ); |
260 | 260 | |
261 | 261 | /** This filter is documented in wp-admin/network/site-users.php */ |
@@ -203,36 +203,36 @@ |
||
203 | 203 | |
204 | 204 | if ( isset($_GET['update']) ) : |
205 | 205 | switch($_GET['update']) { |
206 | - case 'adduser': |
|
207 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
208 | - break; |
|
209 | - case 'err_add_member': |
|
210 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
211 | - break; |
|
212 | - case 'err_add_notfound': |
|
213 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
214 | - break; |
|
215 | - case 'promote': |
|
216 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
217 | - break; |
|
218 | - case 'err_promote': |
|
219 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
220 | - break; |
|
221 | - case 'remove': |
|
222 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
223 | - break; |
|
224 | - case 'err_remove': |
|
225 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
226 | - break; |
|
227 | - case 'newuser': |
|
228 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
229 | - break; |
|
230 | - case 'err_new': |
|
231 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
232 | - break; |
|
233 | - case 'err_new_dup': |
|
234 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
235 | - break; |
|
206 | + case 'adduser': |
|
207 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
208 | + break; |
|
209 | + case 'err_add_member': |
|
210 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
211 | + break; |
|
212 | + case 'err_add_notfound': |
|
213 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
214 | + break; |
|
215 | + case 'promote': |
|
216 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
217 | + break; |
|
218 | + case 'err_promote': |
|
219 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
220 | + break; |
|
221 | + case 'remove': |
|
222 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
223 | + break; |
|
224 | + case 'err_remove': |
|
225 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
226 | + break; |
|
227 | + case 'newuser': |
|
228 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
229 | + break; |
|
230 | + case 'err_new': |
|
231 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
232 | + break; |
|
233 | + case 'err_new_dup': |
|
234 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
235 | + break; |
|
236 | 236 | } |
237 | 237 | endif; ?> |
238 | 238 |
@@ -8,91 +8,91 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -if ( ! current_user_can('manage_sites') ) |
|
16 | +if ( ! current_user_can('manage_sites')) |
|
17 | 17 | wp_die(__('You do not have sufficient permissions to edit this site.')); |
18 | 18 | |
19 | 19 | $wp_list_table = _get_list_table('WP_Users_List_Table'); |
20 | 20 | $wp_list_table->prepare_items(); |
21 | 21 | |
22 | -get_current_screen()->add_help_tab( array( |
|
22 | +get_current_screen()->add_help_tab(array( |
|
23 | 23 | 'id' => 'overview', |
24 | 24 | 'title' => __('Overview'), |
25 | 25 | 'content' => |
26 | - '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' . |
|
27 | - '<p>' . __('<strong>Info</strong> — The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' . |
|
28 | - '<p>' . __('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' . |
|
29 | - '<p>' . sprintf( __('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' . |
|
30 | - '<p>' . __('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' |
|
31 | -) ); |
|
26 | + '<p>'.__('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.').'</p>'. |
|
27 | + '<p>'.__('<strong>Info</strong> — The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.').'</p>'. |
|
28 | + '<p>'.__('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.').'</p>'. |
|
29 | + '<p>'.sprintf(__('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.'), network_admin_url('themes.php')).'</p>'. |
|
30 | + '<p>'.__('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.').'</p>' |
|
31 | +)); |
|
32 | 32 | |
33 | 33 | get_current_screen()->set_help_sidebar( |
34 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
35 | - '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' . |
|
36 | - '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>' |
|
34 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
35 | + '<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>').'</p>'. |
|
36 | + '<p>'.__('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>').'</p>' |
|
37 | 37 | ); |
38 | 38 | |
39 | -$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] ); |
|
40 | -$referer = remove_query_arg( 'update', wp_get_referer() ); |
|
39 | +$_SERVER['REQUEST_URI'] = remove_query_arg('update', $_SERVER['REQUEST_URI']); |
|
40 | +$referer = remove_query_arg('update', wp_get_referer()); |
|
41 | 41 | |
42 | -if ( ! empty( $_REQUEST['paged'] ) ) { |
|
43 | - $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer ); |
|
42 | +if ( ! empty($_REQUEST['paged'])) { |
|
43 | + $referer = add_query_arg('paged', (int) $_REQUEST['paged'], $referer); |
|
44 | 44 | } |
45 | 45 | |
46 | -$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
|
46 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
47 | 47 | |
48 | -if ( ! $id ) |
|
49 | - wp_die( __('Invalid site ID.') ); |
|
48 | +if ( ! $id) |
|
49 | + wp_die(__('Invalid site ID.')); |
|
50 | 50 | |
51 | -$details = get_blog_details( $id ); |
|
52 | -if ( ! $details ) { |
|
53 | - wp_die( __( 'The requested site does not exist.' ) ); |
|
51 | +$details = get_blog_details($id); |
|
52 | +if ( ! $details) { |
|
53 | + wp_die(__('The requested site does not exist.')); |
|
54 | 54 | } |
55 | 55 | |
56 | -if ( ! can_edit_network( $details->site_id ) ) |
|
57 | - wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
|
56 | +if ( ! can_edit_network($details->site_id)) |
|
57 | + wp_die(__('You do not have permission to access this page.'), 403); |
|
58 | 58 | |
59 | -$is_main_site = is_main_site( $id ); |
|
59 | +$is_main_site = is_main_site($id); |
|
60 | 60 | |
61 | -switch_to_blog( $id ); |
|
61 | +switch_to_blog($id); |
|
62 | 62 | |
63 | 63 | $action = $wp_list_table->current_action(); |
64 | 64 | |
65 | -if ( $action ) { |
|
65 | +if ($action) { |
|
66 | 66 | |
67 | - switch ( $action ) { |
|
67 | + switch ($action) { |
|
68 | 68 | case 'newuser': |
69 | - check_admin_referer( 'add-user', '_wpnonce_add-new-user' ); |
|
69 | + check_admin_referer('add-user', '_wpnonce_add-new-user'); |
|
70 | 70 | $user = $_POST['user']; |
71 | - if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) { |
|
71 | + if ( ! is_array($_POST['user']) || empty($user['username']) || empty($user['email'])) { |
|
72 | 72 | $update = 'err_new'; |
73 | 73 | } else { |
74 | - $password = wp_generate_password( 12, false); |
|
75 | - $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); |
|
74 | + $password = wp_generate_password(12, false); |
|
75 | + $user_id = wpmu_create_user(esc_html(strtolower($user['username'])), $password, esc_html($user['email'])); |
|
76 | 76 | |
77 | - if ( false === $user_id ) { |
|
77 | + if (false === $user_id) { |
|
78 | 78 | $update = 'err_new_dup'; |
79 | 79 | } else { |
80 | - wp_new_user_notification( $user_id, 'both' ); |
|
81 | - add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
|
80 | + wp_new_user_notification($user_id, 'both'); |
|
81 | + add_user_to_blog($id, $user_id, $_POST['new_role']); |
|
82 | 82 | $update = 'newuser'; |
83 | 83 | } |
84 | 84 | } |
85 | 85 | break; |
86 | 86 | |
87 | 87 | case 'adduser': |
88 | - check_admin_referer( 'add-user', '_wpnonce_add-user' ); |
|
89 | - if ( !empty( $_POST['newuser'] ) ) { |
|
88 | + check_admin_referer('add-user', '_wpnonce_add-user'); |
|
89 | + if ( ! empty($_POST['newuser'])) { |
|
90 | 90 | $update = 'adduser'; |
91 | 91 | $newuser = $_POST['newuser']; |
92 | - $user = get_user_by( 'login', $newuser ); |
|
93 | - if ( $user && $user->exists() ) { |
|
94 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
95 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
92 | + $user = get_user_by('login', $newuser); |
|
93 | + if ($user && $user->exists()) { |
|
94 | + if ( ! is_user_member_of_blog($user->ID, $id)) |
|
95 | + add_user_to_blog($id, $user->ID, $_POST['new_role']); |
|
96 | 96 | else |
97 | 97 | $update = 'err_add_member'; |
98 | 98 | } else { |
@@ -104,43 +104,43 @@ discard block |
||
104 | 104 | break; |
105 | 105 | |
106 | 106 | case 'remove': |
107 | - if ( ! current_user_can( 'remove_users' ) ) |
|
107 | + if ( ! current_user_can('remove_users')) |
|
108 | 108 | die(__('You can’t remove users.')); |
109 | - check_admin_referer( 'bulk-users' ); |
|
109 | + check_admin_referer('bulk-users'); |
|
110 | 110 | |
111 | 111 | $update = 'remove'; |
112 | - if ( isset( $_REQUEST['users'] ) ) { |
|
112 | + if (isset($_REQUEST['users'])) { |
|
113 | 113 | $userids = $_REQUEST['users']; |
114 | 114 | |
115 | - foreach ( $userids as $user_id ) { |
|
115 | + foreach ($userids as $user_id) { |
|
116 | 116 | $user_id = (int) $user_id; |
117 | - remove_user_from_blog( $user_id, $id ); |
|
117 | + remove_user_from_blog($user_id, $id); |
|
118 | 118 | } |
119 | - } elseif ( isset( $_GET['user'] ) ) { |
|
120 | - remove_user_from_blog( $_GET['user'] ); |
|
119 | + } elseif (isset($_GET['user'])) { |
|
120 | + remove_user_from_blog($_GET['user']); |
|
121 | 121 | } else { |
122 | 122 | $update = 'err_remove'; |
123 | 123 | } |
124 | 124 | break; |
125 | 125 | |
126 | 126 | case 'promote': |
127 | - check_admin_referer( 'bulk-users' ); |
|
127 | + check_admin_referer('bulk-users'); |
|
128 | 128 | $editable_roles = get_editable_roles(); |
129 | - if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) |
|
129 | + if (empty($editable_roles[$_REQUEST['new_role']])) |
|
130 | 130 | wp_die(__('You can’t give users that role.')); |
131 | 131 | |
132 | - if ( isset( $_REQUEST['users'] ) ) { |
|
132 | + if (isset($_REQUEST['users'])) { |
|
133 | 133 | $userids = $_REQUEST['users']; |
134 | 134 | $update = 'promote'; |
135 | - foreach ( $userids as $user_id ) { |
|
135 | + foreach ($userids as $user_id) { |
|
136 | 136 | $user_id = (int) $user_id; |
137 | 137 | |
138 | 138 | // If the user doesn't already belong to the blog, bail. |
139 | - if ( !is_user_member_of_blog( $user_id ) ) |
|
140 | - wp_die( __( 'Cheatin’ uh?' ), 403 ); |
|
139 | + if ( ! is_user_member_of_blog($user_id)) |
|
140 | + wp_die(__('Cheatin’ uh?'), 403); |
|
141 | 141 | |
142 | - $user = get_userdata( $user_id ); |
|
143 | - $user->set_role( $_REQUEST['new_role'] ); |
|
142 | + $user = get_userdata($user_id); |
|
143 | + $user->set_role($_REQUEST['new_role']); |
|
144 | 144 | } |
145 | 145 | } else { |
146 | 146 | $update = 'err_promote'; |
@@ -148,20 +148,20 @@ discard block |
||
148 | 148 | break; |
149 | 149 | } |
150 | 150 | |
151 | - wp_safe_redirect( add_query_arg( 'update', $update, $referer ) ); |
|
151 | + wp_safe_redirect(add_query_arg('update', $update, $referer)); |
|
152 | 152 | exit(); |
153 | 153 | } |
154 | 154 | |
155 | 155 | restore_current_blog(); |
156 | 156 | |
157 | -if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { |
|
158 | - wp_safe_redirect( $referer ); |
|
157 | +if (isset($_GET['action']) && 'update-site' == $_GET['action']) { |
|
158 | + wp_safe_redirect($referer); |
|
159 | 159 | exit(); |
160 | 160 | } |
161 | 161 | |
162 | -add_screen_option( 'per_page' ); |
|
162 | +add_screen_option('per_page'); |
|
163 | 163 | |
164 | -$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
|
164 | +$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname)); |
|
165 | 165 | |
166 | 166 | $parent_file = 'sites.php'; |
167 | 167 | $submenu_file = 'sites.php'; |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
175 | 175 | */ |
176 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
177 | - wp_enqueue_script( 'user-suggest' ); |
|
176 | +if ( ! wp_is_large_network('users') && apply_filters('show_network_site_users_add_existing_form', true)) |
|
177 | + wp_enqueue_script('user-suggest'); |
|
178 | 178 | |
179 | -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
|
179 | +require(ABSPATH.'wp-admin/admin-header.php'); ?> |
|
180 | 180 | |
181 | 181 | <script type="text/javascript"> |
182 | 182 | var current_site_id = <?php echo $id; ?>; |
@@ -185,66 +185,66 @@ discard block |
||
185 | 185 | |
186 | 186 | <div class="wrap"> |
187 | 187 | <h1 id="edit-site"><?php echo $title; ?></h1> |
188 | -<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> |
|
188 | +<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> |
|
189 | 189 | <h3 class="nav-tab-wrapper"> |
190 | 190 | <?php |
191 | 191 | $tabs = array( |
192 | - 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ), |
|
193 | - 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ), |
|
194 | - 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ), |
|
195 | - 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ), |
|
192 | + 'site-info' => array('label' => __('Info'), 'url' => 'site-info.php'), |
|
193 | + 'site-users' => array('label' => __('Users'), 'url' => 'site-users.php'), |
|
194 | + 'site-themes' => array('label' => __('Themes'), 'url' => 'site-themes.php'), |
|
195 | + 'site-settings' => array('label' => __('Settings'), 'url' => 'site-settings.php'), |
|
196 | 196 | ); |
197 | -foreach ( $tabs as $tab_id => $tab ) { |
|
198 | - $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : ''; |
|
199 | - echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>'; |
|
197 | +foreach ($tabs as $tab_id => $tab) { |
|
198 | + $class = ($tab['url'] == $pagenow) ? ' nav-tab-active' : ''; |
|
199 | + echo '<a href="'.$tab['url'].'?id='.$id.'" class="nav-tab'.$class.'">'.esc_html($tab['label']).'</a>'; |
|
200 | 200 | } |
201 | 201 | ?> |
202 | 202 | </h3><?php |
203 | 203 | |
204 | -if ( isset($_GET['update']) ) : |
|
205 | - switch($_GET['update']) { |
|
204 | +if (isset($_GET['update'])) : |
|
205 | + switch ($_GET['update']) { |
|
206 | 206 | case 'adduser': |
207 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
207 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User added.').'</p></div>'; |
|
208 | 208 | break; |
209 | 209 | case 'err_add_member': |
210 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
210 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('User is already a member of this site.').'</p></div>'; |
|
211 | 211 | break; |
212 | 212 | case 'err_add_notfound': |
213 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
213 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username of an existing user.').'</p></div>'; |
|
214 | 214 | break; |
215 | 215 | case 'promote': |
216 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
216 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('Changed roles.').'</p></div>'; |
|
217 | 217 | break; |
218 | 218 | case 'err_promote': |
219 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
219 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to change role.').'</p></div>'; |
|
220 | 220 | break; |
221 | 221 | case 'remove': |
222 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
222 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User removed from this site.').'</p></div>'; |
|
223 | 223 | break; |
224 | 224 | case 'err_remove': |
225 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
225 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to remove.').'</p></div>'; |
|
226 | 226 | break; |
227 | 227 | case 'newuser': |
228 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
228 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User created.').'</p></div>'; |
|
229 | 229 | break; |
230 | 230 | case 'err_new': |
231 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
231 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username and email.').'</p></div>'; |
|
232 | 232 | break; |
233 | 233 | case 'err_new_dup': |
234 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
234 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Duplicated username or email address.').'</p></div>'; |
|
235 | 235 | break; |
236 | 236 | } |
237 | 237 | endif; ?> |
238 | 238 | |
239 | 239 | <form class="search-form" method="get"> |
240 | -<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> |
|
241 | -<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
240 | +<?php $wp_list_table->search_box(__('Search Users'), 'user'); ?> |
|
241 | +<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
242 | 242 | </form> |
243 | 243 | |
244 | 244 | <?php $wp_list_table->views(); ?> |
245 | 245 | |
246 | 246 | <form method="post" action="site-users.php?action=update-site"> |
247 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
247 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
248 | 248 | |
249 | 249 | <?php $wp_list_table->display(); ?> |
250 | 250 | |
@@ -256,27 +256,27 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @since 3.1.0 |
258 | 258 | */ |
259 | -do_action( 'network_site_users_after_list_table' ); |
|
259 | +do_action('network_site_users_after_list_table'); |
|
260 | 260 | |
261 | 261 | /** This filter is documented in wp-admin/network/site-users.php */ |
262 | -if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?> |
|
263 | -<h3 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h3> |
|
262 | +if (current_user_can('promote_users') && apply_filters('show_network_site_users_add_existing_form', true)) : ?> |
|
263 | +<h3 id="add-existing-user"><?php _e('Add Existing User'); ?></h3> |
|
264 | 264 | <form action="site-users.php?action=adduser" id="adduser" method="post"> |
265 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
265 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
266 | 266 | <table class="form-table"> |
267 | 267 | <tr> |
268 | - <th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th> |
|
268 | + <th scope="row"><label for="newuser"><?php _e('Username'); ?></label></th> |
|
269 | 269 | <td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td> |
270 | 270 | </tr> |
271 | 271 | <tr> |
272 | - <th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th> |
|
272 | + <th scope="row"><label for="new_role_adduser"><?php _e('Role'); ?></label></th> |
|
273 | 273 | <td><select name="new_role" id="new_role_adduser"> |
274 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
274 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
275 | 275 | </select></td> |
276 | 276 | </tr> |
277 | 277 | </table> |
278 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?> |
|
279 | - <?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?> |
|
278 | + <?php wp_nonce_field('add-user', '_wpnonce_add-user') ?> |
|
279 | + <?php submit_button(__('Add User'), 'primary', 'add-user', true, array('id' => 'submit-add-existing-user')); ?> |
|
280 | 280 | </form> |
281 | 281 | <?php endif; ?> |
282 | 282 | |
@@ -288,33 +288,33 @@ discard block |
||
288 | 288 | * |
289 | 289 | * @param bool $bool Whether to show the Add New User form. Default true. |
290 | 290 | */ |
291 | -if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?> |
|
292 | -<h3 id="add-new-user"><?php _e( 'Add New User' ); ?></h3> |
|
291 | +if (current_user_can('create_users') && apply_filters('show_network_site_users_add_new_form', true)) : ?> |
|
292 | +<h3 id="add-new-user"><?php _e('Add New User'); ?></h3> |
|
293 | 293 | <form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post"> |
294 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
294 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
295 | 295 | <table class="form-table"> |
296 | 296 | <tr> |
297 | - <th scope="row"><label for="user_username"><?php _e( 'Username' ) ?></label></th> |
|
297 | + <th scope="row"><label for="user_username"><?php _e('Username') ?></label></th> |
|
298 | 298 | <td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td> |
299 | 299 | </tr> |
300 | 300 | <tr> |
301 | - <th scope="row"><label for="user_email"><?php _e( 'Email' ) ?></label></th> |
|
301 | + <th scope="row"><label for="user_email"><?php _e('Email') ?></label></th> |
|
302 | 302 | <td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td> |
303 | 303 | </tr> |
304 | 304 | <tr> |
305 | - <th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th> |
|
305 | + <th scope="row"><label for="new_role_newuser"><?php _e('Role'); ?></label></th> |
|
306 | 306 | <td><select name="new_role" id="new_role_newuser"> |
307 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
307 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
308 | 308 | </select></td> |
309 | 309 | </tr> |
310 | 310 | <tr class="form-field"> |
311 | - <td colspan="2"><?php _e( 'A password reset link will be sent to the user via email.' ) ?></td> |
|
311 | + <td colspan="2"><?php _e('A password reset link will be sent to the user via email.') ?></td> |
|
312 | 312 | </tr> |
313 | 313 | </table> |
314 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?> |
|
315 | - <?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?> |
|
314 | + <?php wp_nonce_field('add-user', '_wpnonce_add-new-user') ?> |
|
315 | + <?php submit_button(__('Add New User'), 'primary', 'add-user', true, array('id' => 'submit-add-user')); ?> |
|
316 | 316 | </form> |
317 | 317 | <?php endif; ?> |
318 | 318 | </div> |
319 | 319 | <?php |
320 | -require( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
320 | +require(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -10,11 +10,13 @@ discard block |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | -if ( ! current_user_can('manage_sites') ) |
|
17 | +if ( ! current_user_can('manage_sites') ) { |
|
17 | 18 | wp_die(__('You do not have sufficient permissions to edit this site.')); |
19 | +} |
|
18 | 20 | |
19 | 21 | $wp_list_table = _get_list_table('WP_Users_List_Table'); |
20 | 22 | $wp_list_table->prepare_items(); |
@@ -45,16 +47,18 @@ discard block |
||
45 | 47 | |
46 | 48 | $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
47 | 49 | |
48 | -if ( ! $id ) |
|
50 | +if ( ! $id ) { |
|
49 | 51 | wp_die( __('Invalid site ID.') ); |
52 | +} |
|
50 | 53 | |
51 | 54 | $details = get_blog_details( $id ); |
52 | 55 | if ( ! $details ) { |
53 | 56 | wp_die( __( 'The requested site does not exist.' ) ); |
54 | 57 | } |
55 | 58 | |
56 | -if ( ! can_edit_network( $details->site_id ) ) |
|
59 | +if ( ! can_edit_network( $details->site_id ) ) { |
|
57 | 60 | wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
61 | +} |
|
58 | 62 | |
59 | 63 | $is_main_site = is_main_site( $id ); |
60 | 64 | |
@@ -91,10 +95,11 @@ discard block |
||
91 | 95 | $newuser = $_POST['newuser']; |
92 | 96 | $user = get_user_by( 'login', $newuser ); |
93 | 97 | if ( $user && $user->exists() ) { |
94 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
95 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
96 | - else |
|
97 | - $update = 'err_add_member'; |
|
98 | + if ( ! is_user_member_of_blog( $user->ID, $id ) ) { |
|
99 | + add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
100 | + } else { |
|
101 | + $update = 'err_add_member'; |
|
102 | + } |
|
98 | 103 | } else { |
99 | 104 | $update = 'err_add_notfound'; |
100 | 105 | } |
@@ -104,8 +109,9 @@ discard block |
||
104 | 109 | break; |
105 | 110 | |
106 | 111 | case 'remove': |
107 | - if ( ! current_user_can( 'remove_users' ) ) |
|
108 | - die(__('You can’t remove users.')); |
|
112 | + if ( ! current_user_can( 'remove_users' ) ) { |
|
113 | + die(__('You can’t remove users.')); |
|
114 | + } |
|
109 | 115 | check_admin_referer( 'bulk-users' ); |
110 | 116 | |
111 | 117 | $update = 'remove'; |
@@ -126,8 +132,9 @@ discard block |
||
126 | 132 | case 'promote': |
127 | 133 | check_admin_referer( 'bulk-users' ); |
128 | 134 | $editable_roles = get_editable_roles(); |
129 | - if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) |
|
130 | - wp_die(__('You can’t give users that role.')); |
|
135 | + if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) { |
|
136 | + wp_die(__('You can’t give users that role.')); |
|
137 | + } |
|
131 | 138 | |
132 | 139 | if ( isset( $_REQUEST['users'] ) ) { |
133 | 140 | $userids = $_REQUEST['users']; |
@@ -136,8 +143,9 @@ discard block |
||
136 | 143 | $user_id = (int) $user_id; |
137 | 144 | |
138 | 145 | // If the user doesn't already belong to the blog, bail. |
139 | - if ( !is_user_member_of_blog( $user_id ) ) |
|
140 | - wp_die( __( 'Cheatin’ uh?' ), 403 ); |
|
146 | + if ( !is_user_member_of_blog( $user_id ) ) { |
|
147 | + wp_die( __( 'Cheatin’ uh?' ), 403 ); |
|
148 | + } |
|
141 | 149 | |
142 | 150 | $user = get_userdata( $user_id ); |
143 | 151 | $user->set_role( $_REQUEST['new_role'] ); |
@@ -173,8 +181,9 @@ discard block |
||
173 | 181 | * |
174 | 182 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
175 | 183 | */ |
176 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
184 | +if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) { |
|
177 | 185 | wp_enqueue_script( 'user-suggest' ); |
186 | +} |
|
178 | 187 | |
179 | 188 | require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
180 | 189 |
@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -require( ABSPATH . 'wp-admin/plugin-editor.php' ); |
|
16 | +require(ABSPATH.'wp-admin/plugin-editor.php'); |
@@ -10,7 +10,8 @@ |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | 17 | require( ABSPATH . 'wp-admin/plugin-editor.php' ); |
@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -require( ABSPATH . 'wp-admin/network.php' ); |
|
16 | +require(ABSPATH.'wp-admin/network.php'); |
@@ -10,7 +10,8 @@ |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | 17 | require( ABSPATH . 'wp-admin/network.php' ); |
@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -require( ABSPATH . 'wp-admin/theme-editor.php' ); |
|
16 | +require(ABSPATH.'wp-admin/theme-editor.php'); |
@@ -10,7 +10,8 @@ |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | 17 | require( ABSPATH . 'wp-admin/theme-editor.php' ); |
@@ -8,29 +8,29 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -if ( ! current_user_can( 'manage_sites' ) ) |
|
17 | - wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) ); |
|
16 | +if ( ! current_user_can('manage_sites')) |
|
17 | + wp_die(__('You do not have sufficient permissions to manage themes for this site.')); |
|
18 | 18 | |
19 | -get_current_screen()->add_help_tab( array( |
|
19 | +get_current_screen()->add_help_tab(array( |
|
20 | 20 | 'id' => 'overview', |
21 | 21 | 'title' => __('Overview'), |
22 | 22 | 'content' => |
23 | - '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' . |
|
24 | - '<p>' . __('<strong>Info</strong> — The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' . |
|
25 | - '<p>' . __('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' . |
|
26 | - '<p>' . sprintf( __('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' . |
|
27 | - '<p>' . __('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' |
|
28 | -) ); |
|
23 | + '<p>'.__('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.').'</p>'. |
|
24 | + '<p>'.__('<strong>Info</strong> — The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.').'</p>'. |
|
25 | + '<p>'.__('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.').'</p>'. |
|
26 | + '<p>'.sprintf(__('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.'), network_admin_url('themes.php')).'</p>'. |
|
27 | + '<p>'.__('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.').'</p>' |
|
28 | +)); |
|
29 | 29 | |
30 | 30 | get_current_screen()->set_help_sidebar( |
31 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
32 | - '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' . |
|
33 | - '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>' |
|
31 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
32 | + '<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>').'</p>'. |
|
33 | + '<p>'.__('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>').'</p>' |
|
34 | 34 | ); |
35 | 35 | |
36 | 36 | $wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); |
@@ -40,77 +40,77 @@ discard block |
||
40 | 40 | $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; |
41 | 41 | |
42 | 42 | // Clean up request URI from temporary args for screen options/paging uri's to work as expected. |
43 | -$temp_args = array( 'enabled', 'disabled', 'error' ); |
|
44 | -$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] ); |
|
45 | -$referer = remove_query_arg( $temp_args, wp_get_referer() ); |
|
43 | +$temp_args = array('enabled', 'disabled', 'error'); |
|
44 | +$_SERVER['REQUEST_URI'] = remove_query_arg($temp_args, $_SERVER['REQUEST_URI']); |
|
45 | +$referer = remove_query_arg($temp_args, wp_get_referer()); |
|
46 | 46 | |
47 | -if ( ! empty( $_REQUEST['paged'] ) ) { |
|
48 | - $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer ); |
|
47 | +if ( ! empty($_REQUEST['paged'])) { |
|
48 | + $referer = add_query_arg('paged', (int) $_REQUEST['paged'], $referer); |
|
49 | 49 | } |
50 | 50 | |
51 | -$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
|
51 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
52 | 52 | |
53 | -if ( ! $id ) |
|
54 | - wp_die( __('Invalid site ID.') ); |
|
53 | +if ( ! $id) |
|
54 | + wp_die(__('Invalid site ID.')); |
|
55 | 55 | |
56 | 56 | $wp_list_table->prepare_items(); |
57 | 57 | |
58 | -$details = get_blog_details( $id ); |
|
59 | -if ( ! $details ) { |
|
60 | - wp_die( __( 'The requested site does not exist.' ) ); |
|
58 | +$details = get_blog_details($id); |
|
59 | +if ( ! $details) { |
|
60 | + wp_die(__('The requested site does not exist.')); |
|
61 | 61 | } |
62 | 62 | |
63 | -if ( !can_edit_network( $details->site_id ) ) |
|
64 | - wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
|
63 | +if ( ! can_edit_network($details->site_id)) |
|
64 | + wp_die(__('You do not have permission to access this page.'), 403); |
|
65 | 65 | |
66 | -$is_main_site = is_main_site( $id ); |
|
66 | +$is_main_site = is_main_site($id); |
|
67 | 67 | |
68 | -if ( $action ) { |
|
69 | - switch_to_blog( $id ); |
|
70 | - $allowed_themes = get_option( 'allowedthemes' ); |
|
68 | +if ($action) { |
|
69 | + switch_to_blog($id); |
|
70 | + $allowed_themes = get_option('allowedthemes'); |
|
71 | 71 | |
72 | - switch ( $action ) { |
|
72 | + switch ($action) { |
|
73 | 73 | case 'enable': |
74 | - check_admin_referer( 'enable-theme_' . $_GET['theme'] ); |
|
74 | + check_admin_referer('enable-theme_'.$_GET['theme']); |
|
75 | 75 | $theme = $_GET['theme']; |
76 | 76 | $action = 'enabled'; |
77 | 77 | $n = 1; |
78 | - if ( !$allowed_themes ) |
|
79 | - $allowed_themes = array( $theme => true ); |
|
78 | + if ( ! $allowed_themes) |
|
79 | + $allowed_themes = array($theme => true); |
|
80 | 80 | else |
81 | 81 | $allowed_themes[$theme] = true; |
82 | 82 | break; |
83 | 83 | case 'disable': |
84 | - check_admin_referer( 'disable-theme_' . $_GET['theme'] ); |
|
84 | + check_admin_referer('disable-theme_'.$_GET['theme']); |
|
85 | 85 | $theme = $_GET['theme']; |
86 | 86 | $action = 'disabled'; |
87 | 87 | $n = 1; |
88 | - if ( !$allowed_themes ) |
|
88 | + if ( ! $allowed_themes) |
|
89 | 89 | $allowed_themes = array(); |
90 | 90 | else |
91 | - unset( $allowed_themes[$theme] ); |
|
91 | + unset($allowed_themes[$theme]); |
|
92 | 92 | break; |
93 | 93 | case 'enable-selected': |
94 | - check_admin_referer( 'bulk-themes' ); |
|
95 | - if ( isset( $_POST['checked'] ) ) { |
|
94 | + check_admin_referer('bulk-themes'); |
|
95 | + if (isset($_POST['checked'])) { |
|
96 | 96 | $themes = (array) $_POST['checked']; |
97 | 97 | $action = 'enabled'; |
98 | - $n = count( $themes ); |
|
99 | - foreach( (array) $themes as $theme ) |
|
100 | - $allowed_themes[ $theme ] = true; |
|
98 | + $n = count($themes); |
|
99 | + foreach ((array) $themes as $theme) |
|
100 | + $allowed_themes[$theme] = true; |
|
101 | 101 | } else { |
102 | 102 | $action = 'error'; |
103 | 103 | $n = 'none'; |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | case 'disable-selected': |
107 | - check_admin_referer( 'bulk-themes' ); |
|
108 | - if ( isset( $_POST['checked'] ) ) { |
|
107 | + check_admin_referer('bulk-themes'); |
|
108 | + if (isset($_POST['checked'])) { |
|
109 | 109 | $themes = (array) $_POST['checked']; |
110 | 110 | $action = 'disabled'; |
111 | - $n = count( $themes ); |
|
112 | - foreach( (array) $themes as $theme ) |
|
113 | - unset( $allowed_themes[ $theme ] ); |
|
111 | + $n = count($themes); |
|
112 | + foreach ((array) $themes as $theme) |
|
113 | + unset($allowed_themes[$theme]); |
|
114 | 114 | } else { |
115 | 115 | $action = 'error'; |
116 | 116 | $n = 'none'; |
@@ -118,81 +118,81 @@ discard block |
||
118 | 118 | break; |
119 | 119 | } |
120 | 120 | |
121 | - update_option( 'allowedthemes', $allowed_themes ); |
|
121 | + update_option('allowedthemes', $allowed_themes); |
|
122 | 122 | restore_current_blog(); |
123 | 123 | |
124 | - wp_safe_redirect( add_query_arg( array( 'id' => $id, $action => $n ), $referer ) ); |
|
124 | + wp_safe_redirect(add_query_arg(array('id' => $id, $action => $n), $referer)); |
|
125 | 125 | exit; |
126 | 126 | } |
127 | 127 | |
128 | -if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { |
|
129 | - wp_safe_redirect( $referer ); |
|
128 | +if (isset($_GET['action']) && 'update-site' == $_GET['action']) { |
|
129 | + wp_safe_redirect($referer); |
|
130 | 130 | exit(); |
131 | 131 | } |
132 | 132 | |
133 | 133 | add_thickbox(); |
134 | -add_screen_option( 'per_page' ); |
|
134 | +add_screen_option('per_page'); |
|
135 | 135 | |
136 | -$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
|
136 | +$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname)); |
|
137 | 137 | |
138 | 138 | $parent_file = 'sites.php'; |
139 | 139 | $submenu_file = 'sites.php'; |
140 | 140 | |
141 | -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
|
141 | +require(ABSPATH.'wp-admin/admin-header.php'); ?> |
|
142 | 142 | |
143 | 143 | <div class="wrap"> |
144 | 144 | <h1 id="edit-site"><?php echo $title; ?></h1> |
145 | -<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> |
|
145 | +<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> |
|
146 | 146 | <h3 class="nav-tab-wrapper"> |
147 | 147 | <?php |
148 | 148 | $tabs = array( |
149 | - 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ), |
|
150 | - 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ), |
|
151 | - 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ), |
|
152 | - 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ), |
|
149 | + 'site-info' => array('label' => __('Info'), 'url' => 'site-info.php'), |
|
150 | + 'site-users' => array('label' => __('Users'), 'url' => 'site-users.php'), |
|
151 | + 'site-themes' => array('label' => __('Themes'), 'url' => 'site-themes.php'), |
|
152 | + 'site-settings' => array('label' => __('Settings'), 'url' => 'site-settings.php'), |
|
153 | 153 | ); |
154 | -foreach ( $tabs as $tab_id => $tab ) { |
|
155 | - $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : ''; |
|
156 | - echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>'; |
|
154 | +foreach ($tabs as $tab_id => $tab) { |
|
155 | + $class = ($tab['url'] == $pagenow) ? ' nav-tab-active' : ''; |
|
156 | + echo '<a href="'.$tab['url'].'?id='.$id.'" class="nav-tab'.$class.'">'.esc_html($tab['label']).'</a>'; |
|
157 | 157 | } |
158 | 158 | ?> |
159 | 159 | </h3><?php |
160 | 160 | |
161 | -if ( isset( $_GET['enabled'] ) ) { |
|
162 | - $enabled = absint( $_GET['enabled'] ); |
|
163 | - if ( 1 == $enabled ) { |
|
164 | - $message = __( 'Theme enabled.' ); |
|
161 | +if (isset($_GET['enabled'])) { |
|
162 | + $enabled = absint($_GET['enabled']); |
|
163 | + if (1 == $enabled) { |
|
164 | + $message = __('Theme enabled.'); |
|
165 | 165 | } else { |
166 | - $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled ); |
|
166 | + $message = _n('%s theme enabled.', '%s themes enabled.', $enabled); |
|
167 | 167 | } |
168 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; |
|
169 | -} elseif ( isset( $_GET['disabled'] ) ) { |
|
170 | - $disabled = absint( $_GET['disabled'] ); |
|
171 | - if ( 1 == $disabled ) { |
|
172 | - $message = __( 'Theme disabled.' ); |
|
168 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.sprintf($message, number_format_i18n($enabled)).'</p></div>'; |
|
169 | +} elseif (isset($_GET['disabled'])) { |
|
170 | + $disabled = absint($_GET['disabled']); |
|
171 | + if (1 == $disabled) { |
|
172 | + $message = __('Theme disabled.'); |
|
173 | 173 | } else { |
174 | - $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); |
|
174 | + $message = _n('%s theme disabled.', '%s themes disabled.', $disabled); |
|
175 | 175 | } |
176 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; |
|
177 | -} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) { |
|
178 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; |
|
176 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.sprintf($message, number_format_i18n($disabled)).'</p></div>'; |
|
177 | +} elseif (isset($_GET['error']) && 'none' == $_GET['error']) { |
|
178 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('No theme selected.').'</p></div>'; |
|
179 | 179 | } ?> |
180 | 180 | |
181 | -<p><?php _e( 'Network enabled themes are not shown on this screen.' ) ?></p> |
|
181 | +<p><?php _e('Network enabled themes are not shown on this screen.') ?></p> |
|
182 | 182 | |
183 | 183 | <form method="get"> |
184 | -<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?> |
|
185 | -<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
184 | +<?php $wp_list_table->search_box(__('Search Installed Themes'), 'theme'); ?> |
|
185 | +<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
186 | 186 | </form> |
187 | 187 | |
188 | 188 | <?php $wp_list_table->views(); ?> |
189 | 189 | |
190 | 190 | <form method="post" action="site-themes.php?action=update-site"> |
191 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
191 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
192 | 192 | |
193 | 193 | <?php $wp_list_table->display(); ?> |
194 | 194 | |
195 | 195 | </form> |
196 | 196 | |
197 | 197 | </div> |
198 | -<?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?> |
|
198 | +<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?> |
@@ -10,11 +10,13 @@ discard block |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | -if ( ! current_user_can( 'manage_sites' ) ) |
|
17 | +if ( ! current_user_can( 'manage_sites' ) ) { |
|
17 | 18 | wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) ); |
19 | +} |
|
18 | 20 | |
19 | 21 | get_current_screen()->add_help_tab( array( |
20 | 22 | 'id' => 'overview', |
@@ -50,8 +52,9 @@ discard block |
||
50 | 52 | |
51 | 53 | $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
52 | 54 | |
53 | -if ( ! $id ) |
|
55 | +if ( ! $id ) { |
|
54 | 56 | wp_die( __('Invalid site ID.') ); |
57 | +} |
|
55 | 58 | |
56 | 59 | $wp_list_table->prepare_items(); |
57 | 60 | |
@@ -60,8 +63,9 @@ discard block |
||
60 | 63 | wp_die( __( 'The requested site does not exist.' ) ); |
61 | 64 | } |
62 | 65 | |
63 | -if ( !can_edit_network( $details->site_id ) ) |
|
66 | +if ( !can_edit_network( $details->site_id ) ) { |
|
64 | 67 | wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
68 | +} |
|
65 | 69 | |
66 | 70 | $is_main_site = is_main_site( $id ); |
67 | 71 | |
@@ -75,20 +79,22 @@ discard block |
||
75 | 79 | $theme = $_GET['theme']; |
76 | 80 | $action = 'enabled'; |
77 | 81 | $n = 1; |
78 | - if ( !$allowed_themes ) |
|
79 | - $allowed_themes = array( $theme => true ); |
|
80 | - else |
|
81 | - $allowed_themes[$theme] = true; |
|
82 | + if ( !$allowed_themes ) { |
|
83 | + $allowed_themes = array( $theme => true ); |
|
84 | + } else { |
|
85 | + $allowed_themes[$theme] = true; |
|
86 | + } |
|
82 | 87 | break; |
83 | 88 | case 'disable': |
84 | 89 | check_admin_referer( 'disable-theme_' . $_GET['theme'] ); |
85 | 90 | $theme = $_GET['theme']; |
86 | 91 | $action = 'disabled'; |
87 | 92 | $n = 1; |
88 | - if ( !$allowed_themes ) |
|
89 | - $allowed_themes = array(); |
|
90 | - else |
|
91 | - unset( $allowed_themes[$theme] ); |
|
93 | + if ( !$allowed_themes ) { |
|
94 | + $allowed_themes = array(); |
|
95 | + } else { |
|
96 | + unset( $allowed_themes[$theme] ); |
|
97 | + } |
|
92 | 98 | break; |
93 | 99 | case 'enable-selected': |
94 | 100 | check_admin_referer( 'bulk-themes' ); |
@@ -96,8 +102,9 @@ discard block |
||
96 | 102 | $themes = (array) $_POST['checked']; |
97 | 103 | $action = 'enabled'; |
98 | 104 | $n = count( $themes ); |
99 | - foreach( (array) $themes as $theme ) |
|
100 | - $allowed_themes[ $theme ] = true; |
|
105 | + foreach( (array) $themes as $theme ) { |
|
106 | + $allowed_themes[ $theme ] = true; |
|
107 | + } |
|
101 | 108 | } else { |
102 | 109 | $action = 'error'; |
103 | 110 | $n = 'none'; |
@@ -109,8 +116,9 @@ discard block |
||
109 | 116 | $themes = (array) $_POST['checked']; |
110 | 117 | $action = 'disabled'; |
111 | 118 | $n = count( $themes ); |
112 | - foreach( (array) $themes as $theme ) |
|
113 | - unset( $allowed_themes[ $theme ] ); |
|
119 | + foreach( (array) $themes as $theme ) { |
|
120 | + unset( $allowed_themes[ $theme ] ); |
|
121 | + } |
|
114 | 122 | } else { |
115 | 123 | $action = 'error'; |
116 | 124 | $n = 'none'; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Multisite administration panel. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Multisite |
|
7 | - * @since 3.0.0 |
|
8 | - */ |
|
3 | + * Multisite administration panel. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Multisite |
|
7 | + * @since 3.0.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -8,64 +8,64 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | 13 | /** Load WordPress dashboard API */ |
14 | -require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); |
|
14 | +require_once(ABSPATH.'wp-admin/includes/dashboard.php'); |
|
15 | 15 | |
16 | -if ( !is_multisite() ) |
|
17 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
16 | +if ( ! is_multisite()) |
|
17 | + wp_die(__('Multisite support is not enabled.')); |
|
18 | 18 | |
19 | -if ( ! current_user_can( 'manage_network' ) ) |
|
20 | - wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
|
19 | +if ( ! current_user_can('manage_network')) |
|
20 | + wp_die(__('You do not have permission to access this page.'), 403); |
|
21 | 21 | |
22 | -$title = __( 'Dashboard' ); |
|
22 | +$title = __('Dashboard'); |
|
23 | 23 | $parent_file = 'index.php'; |
24 | 24 | |
25 | -$overview = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>'; |
|
26 | -$overview .= '<p>' . __( 'From here you can:' ) . '</p>'; |
|
27 | -$overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>'; |
|
28 | -$overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>'; |
|
29 | -$overview .= '<li>' . __( 'Update your network' ) . '</li>'; |
|
30 | -$overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>'; |
|
25 | +$overview = '<p>'.__('Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.').'</p>'; |
|
26 | +$overview .= '<p>'.__('From here you can:').'</p>'; |
|
27 | +$overview .= '<ul><li>'.__('Add and manage sites or users').'</li>'; |
|
28 | +$overview .= '<li>'.__('Install and activate themes or plugins').'</li>'; |
|
29 | +$overview .= '<li>'.__('Update your network').'</li>'; |
|
30 | +$overview .= '<li>'.__('Modify global network settings').'</li></ul>'; |
|
31 | 31 | |
32 | -get_current_screen()->add_help_tab( array( |
|
32 | +get_current_screen()->add_help_tab(array( |
|
33 | 33 | 'id' => 'overview', |
34 | - 'title' => __( 'Overview' ), |
|
34 | + 'title' => __('Overview'), |
|
35 | 35 | 'content' => $overview |
36 | -) ); |
|
36 | +)); |
|
37 | 37 | |
38 | -$quick_tasks = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>'; |
|
39 | -$quick_tasks .= '<ul><li>' . __( 'To add a new user, <strong>click Create a New User</strong>.' ) . '</li>'; |
|
40 | -$quick_tasks .= '<li>' . __( 'To add a new site, <strong>click Create a New Site</strong>.' ) . '</li></ul>'; |
|
41 | -$quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>'; |
|
42 | -$quick_tasks .= '<ul><li>' . __( 'To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user*.' ) . '</li>'; |
|
43 | -$quick_tasks .= '<li>' . __( 'To search for a site, <strong>enter the path or domain</strong>.' ) . '</li></ul>'; |
|
38 | +$quick_tasks = '<p>'.__('The Right Now widget on this screen provides current user and site counts on your network.').'</p>'; |
|
39 | +$quick_tasks .= '<ul><li>'.__('To add a new user, <strong>click Create a New User</strong>.').'</li>'; |
|
40 | +$quick_tasks .= '<li>'.__('To add a new site, <strong>click Create a New Site</strong>.').'</li></ul>'; |
|
41 | +$quick_tasks .= '<p>'.__('To search for a user or site, use the search boxes.').'</p>'; |
|
42 | +$quick_tasks .= '<ul><li>'.__('To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user*.').'</li>'; |
|
43 | +$quick_tasks .= '<li>'.__('To search for a site, <strong>enter the path or domain</strong>.').'</li></ul>'; |
|
44 | 44 | |
45 | -get_current_screen()->add_help_tab( array( |
|
45 | +get_current_screen()->add_help_tab(array( |
|
46 | 46 | 'id' => 'quick-tasks', |
47 | - 'title' => __( 'Quick Tasks' ), |
|
47 | + 'title' => __('Quick Tasks'), |
|
48 | 48 | 'content' => $quick_tasks |
49 | -) ); |
|
49 | +)); |
|
50 | 50 | |
51 | 51 | get_current_screen()->set_help_sidebar( |
52 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
53 | - '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin" target="_blank">Documentation on the Network Admin</a>') . '</p>' . |
|
54 | - '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>' |
|
52 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
53 | + '<p>'.__('<a href="https://codex.wordpress.org/Network_Admin" target="_blank">Documentation on the Network Admin</a>').'</p>'. |
|
54 | + '<p>'.__('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>').'</p>' |
|
55 | 55 | ); |
56 | 56 | |
57 | 57 | wp_dashboard_setup(); |
58 | 58 | |
59 | -wp_enqueue_script( 'dashboard' ); |
|
60 | -wp_enqueue_script( 'plugin-install' ); |
|
59 | +wp_enqueue_script('dashboard'); |
|
60 | +wp_enqueue_script('plugin-install'); |
|
61 | 61 | add_thickbox(); |
62 | 62 | |
63 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
63 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
64 | 64 | |
65 | 65 | ?> |
66 | 66 | |
67 | 67 | <div class="wrap"> |
68 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
68 | +<h1><?php echo esc_html($title); ?></h1> |
|
69 | 69 | |
70 | 70 | <div id="dashboard-widgets-wrap"> |
71 | 71 | |
@@ -76,4 +76,4 @@ discard block |
||
76 | 76 | |
77 | 77 | </div><!-- wrap --> |
78 | 78 | |
79 | -<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> |
|
79 | +<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?> |
@@ -13,11 +13,13 @@ |
||
13 | 13 | /** Load WordPress dashboard API */ |
14 | 14 | require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); |
15 | 15 | |
16 | -if ( !is_multisite() ) |
|
16 | +if ( !is_multisite() ) { |
|
17 | 17 | wp_die( __( 'Multisite support is not enabled.' ) ); |
18 | +} |
|
18 | 19 | |
19 | -if ( ! current_user_can( 'manage_network' ) ) |
|
20 | +if ( ! current_user_can( 'manage_network' ) ) { |
|
20 | 21 | wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
22 | +} |
|
21 | 23 | |
22 | 24 | $title = __( 'Dashboard' ); |
23 | 25 | $parent_file = 'index.php'; |
@@ -7,13 +7,13 @@ |
||
7 | 7 | * @since 3.1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) |
|
11 | - define( 'IFRAME_REQUEST', true ); |
|
10 | +if (isset($_GET['tab']) && ('theme-information' == $_GET['tab'])) |
|
11 | + define('IFRAME_REQUEST', true); |
|
12 | 12 | |
13 | 13 | /** Load WordPress Administration Bootstrap */ |
14 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
14 | +require_once(dirname(__FILE__).'/admin.php'); |
|
15 | 15 | |
16 | -if ( ! is_multisite() ) |
|
17 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
16 | +if ( ! is_multisite()) |
|
17 | + wp_die(__('Multisite support is not enabled.')); |
|
18 | 18 | |
19 | -require( ABSPATH . 'wp-admin/theme-install.php' ); |
|
19 | +require(ABSPATH.'wp-admin/theme-install.php'); |
@@ -7,13 +7,15 @@ |
||
7 | 7 | * @since 3.1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) |
|
10 | +if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) { |
|
11 | 11 | define( 'IFRAME_REQUEST', true ); |
12 | +} |
|
12 | 13 | |
13 | 14 | /** Load WordPress Administration Bootstrap */ |
14 | 15 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
15 | 16 | |
16 | -if ( ! is_multisite() ) |
|
17 | +if ( ! is_multisite() ) { |
|
17 | 18 | wp_die( __( 'Multisite support is not enabled.' ) ); |
19 | +} |
|
18 | 20 | |
19 | 21 | require( ABSPATH . 'wp-admin/theme-install.php' ); |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 | +require_once(dirname(__FILE__).'/admin.php'); |
|
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
14 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
13 | +if ( ! is_multisite()) |
|
14 | + wp_die(__('Multisite support is not enabled.')); |
|
15 | 15 | |
16 | -if ( empty( $_GET['action'] ) ) { |
|
17 | - wp_redirect( network_admin_url() ); |
|
16 | +if (empty($_GET['action'])) { |
|
17 | + wp_redirect(network_admin_url()); |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @since 3.0.0 |
28 | 28 | */ |
29 | -do_action( 'wpmuadminedit' ); |
|
29 | +do_action('wpmuadminedit'); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Fires the requested handler action. |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @since 3.1.0 |
38 | 38 | */ |
39 | -do_action( 'network_admin_edit_' . $_GET['action'] ); |
|
39 | +do_action('network_admin_edit_'.$_GET['action']); |
|
40 | 40 | |
41 | -wp_redirect( network_admin_url() ); |
|
41 | +wp_redirect(network_admin_url()); |
|
42 | 42 | exit(); |
@@ -10,8 +10,9 @@ |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! is_multisite() ) |
|
13 | +if ( ! is_multisite() ) { |
|
14 | 14 | wp_die( __( 'Multisite support is not enabled.' ) ); |
15 | +} |
|
15 | 16 | |
16 | 17 | if ( empty( $_GET['action'] ) ) { |
17 | 18 | wp_redirect( network_admin_url() ); |