@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Tools Administration Screen. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * Tools Administration Screen. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -7,68 +7,68 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | 12 | $title = __('Tools'); |
13 | 13 | |
14 | -get_current_screen()->add_help_tab( array( |
|
14 | +get_current_screen()->add_help_tab(array( |
|
15 | 15 | 'id' => 'press-this', |
16 | 16 | 'title' => __('Press This'), |
17 | - 'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>', |
|
18 | -) ); |
|
19 | -get_current_screen()->add_help_tab( array( |
|
17 | + 'content' => '<p>'.__('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.').'</p>', |
|
18 | +)); |
|
19 | +get_current_screen()->add_help_tab(array( |
|
20 | 20 | 'id' => 'converter', |
21 | 21 | 'title' => __('Categories and Tags Converter'), |
22 | - 'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' . |
|
23 | - '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>', |
|
24 | -) ); |
|
22 | + 'content' => '<p>'.__('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.').'</p>'. |
|
23 | + '<p>'.__('The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.').'</p>', |
|
24 | +)); |
|
25 | 25 | |
26 | 26 | get_current_screen()->set_help_sidebar( |
27 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
28 | - '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>') . '</p>' . |
|
29 | - '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
|
27 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
28 | + '<p>'.__('<a href="https://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>').'</p>'. |
|
29 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
30 | 30 | ); |
31 | 31 | |
32 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
32 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
33 | 33 | |
34 | 34 | ?> |
35 | 35 | <div class="wrap"> |
36 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
36 | +<h1><?php echo esc_html($title); ?></h1> |
|
37 | 37 | |
38 | -<?php if ( current_user_can('edit_posts') ) : ?> |
|
38 | +<?php if (current_user_can('edit_posts')) : ?> |
|
39 | 39 | <div class="card pressthis"> |
40 | 40 | <h2><?php _e('Press This') ?></h2> |
41 | - <p><?php _e( 'Press This is a little tool that lets you grab bits of the web and create new posts with ease.' );?></p> |
|
42 | - <p><?php _e( 'Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.' ); ?></p> |
|
41 | + <p><?php _e('Press This is a little tool that lets you grab bits of the web and create new posts with ease.'); ?></p> |
|
42 | + <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p> |
|
43 | 43 | |
44 | 44 | |
45 | 45 | <form> |
46 | - <h3><?php _e( 'Install Press This' ); ?></h3> |
|
47 | - <h4><?php _e( 'Bookmarklet' ); ?></h4> |
|
48 | - <p><?php _e( 'Drag the bookmarklet below to your bookmarks bar. Then, when you’re on a page you want to share, simply “press” it.' ); ?></p> |
|
46 | + <h3><?php _e('Install Press This'); ?></h3> |
|
47 | + <h4><?php _e('Bookmarklet'); ?></h4> |
|
48 | + <p><?php _e('Drag the bookmarklet below to your bookmarks bar. Then, when you’re on a page you want to share, simply “press” it.'); ?></p> |
|
49 | 49 | |
50 | 50 | <p class="pressthis-bookmarklet-wrapper"> |
51 | - <a class="pressthis-bookmarklet" onclick="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This' ); ?></span></a> |
|
51 | + <a class="pressthis-bookmarklet" onclick="return false;" href="<?php echo htmlspecialchars(get_shortcut_link()); ?>"><span><?php _e('Press This'); ?></span></a> |
|
52 | 52 | <button type="button" class="button button-secondary pressthis-js-toggle js-show-pressthis-code-wrap" aria-expanded="false" aria-controls="pressthis-code-wrap"> |
53 | 53 | <span class="dashicons dashicons-clipboard"></span> |
54 | - <span class="screen-reader-text"><?php _e( 'Copy “Press This” bookmarklet code' ) ?></span> |
|
54 | + <span class="screen-reader-text"><?php _e('Copy “Press This” bookmarklet code') ?></span> |
|
55 | 55 | </button> |
56 | 56 | </p> |
57 | 57 | |
58 | 58 | <div class="hidden js-pressthis-code-wrap clear" id="pressthis-code-wrap"> |
59 | 59 | <p id="pressthis-code-desc"> |
60 | - <?php _e( 'If you can’t drag the bookmarklet to your bookmarks, copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.' ) ?> |
|
60 | + <?php _e('If you can’t drag the bookmarklet to your bookmarks, copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.') ?> |
|
61 | 61 | </p> |
62 | 62 | <p> |
63 | - <textarea class="js-pressthis-code" rows="5" cols="120" readonly="readonly" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea> |
|
63 | + <textarea class="js-pressthis-code" rows="5" cols="120" readonly="readonly" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars(get_shortcut_link()); ?></textarea> |
|
64 | 64 | </p> |
65 | 65 | </div> |
66 | 66 | |
67 | - <h4><?php _e( 'Direct link (best for mobile)' ); ?></h4> |
|
68 | - <p><?php _e( 'Follow the link to open Press This. Then add it to your device’s bookmarks or home screen.' ); ?></p> |
|
67 | + <h4><?php _e('Direct link (best for mobile)'); ?></h4> |
|
68 | + <p><?php _e('Follow the link to open Press This. Then add it to your device’s bookmarks or home screen.'); ?></p> |
|
69 | 69 | |
70 | 70 | <p> |
71 | - <a class="button button-secondary" href="<?php echo htmlspecialchars( admin_url( 'press-this.php' ) ); ?>"><?php _e( 'Open Press This' ) ?></a> |
|
71 | + <a class="button button-secondary" href="<?php echo htmlspecialchars(admin_url('press-this.php')); ?>"><?php _e('Open Press This') ?></a> |
|
72 | 72 | </p> |
73 | 73 | <script> |
74 | 74 | jQuery( document ).ready( function( $ ) { |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | endif; |
97 | 97 | |
98 | -if ( current_user_can( 'import' ) ) : |
|
98 | +if (current_user_can('import')) : |
|
99 | 99 | $cats = get_taxonomy('category'); |
100 | 100 | $tags = get_taxonomy('post_tag'); |
101 | -if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?> |
|
101 | +if (current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms)) : ?> |
|
102 | 102 | <div class="card"> |
103 | - <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2> |
|
104 | - <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p> |
|
103 | + <h2 class="title"><?php _e('Categories and Tags Converter') ?></h2> |
|
104 | + <p><?php printf(__('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php'); ?></p> |
|
105 | 105 | </div> |
106 | 106 | <?php |
107 | 107 | endif; |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @since 2.8.0 |
114 | 114 | */ |
115 | -do_action( 'tool_box' ); |
|
115 | +do_action('tool_box'); |
|
116 | 116 | ?> |
117 | 117 | </div> |
118 | 118 | <?php |
119 | -include( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
119 | +include(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -7,8 +7,9 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // don't load directly |
10 | -if ( !defined('ABSPATH') ) |
|
10 | +if ( !defined('ABSPATH') ) { |
|
11 | 11 | die('-1'); |
12 | +} |
|
12 | 13 | ?> |
13 | 14 | <form name="post" action="comment.php" method="post" id="post"> |
14 | 15 | <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?> |
@@ -7,28 +7,28 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // don't load directly |
10 | -if ( !defined('ABSPATH') ) |
|
10 | +if ( ! defined('ABSPATH')) |
|
11 | 11 | die('-1'); |
12 | 12 | ?> |
13 | 13 | <form name="post" action="comment.php" method="post" id="post"> |
14 | -<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?> |
|
14 | +<?php wp_nonce_field('update-comment_'.$comment->comment_ID) ?> |
|
15 | 15 | <div class="wrap"> |
16 | -<h1><?php _e( 'Edit Comment' ); ?></h1> |
|
16 | +<h1><?php _e('Edit Comment'); ?></h1> |
|
17 | 17 | |
18 | 18 | <div id="poststuff"> |
19 | 19 | <input type="hidden" name="action" value="editedcomment" /> |
20 | -<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> |
|
21 | -<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" /> |
|
20 | +<input type="hidden" name="comment_ID" value="<?php echo esc_attr($comment->comment_ID); ?>" /> |
|
21 | +<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr($comment->comment_post_ID); ?>" /> |
|
22 | 22 | |
23 | 23 | <div id="post-body" class="metabox-holder columns-2"> |
24 | 24 | <div id="post-body-content" class="edit-form-section edit-comment-section"> |
25 | 25 | <?php |
26 | -if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) : |
|
27 | - $comment_link = get_comment_link( $comment ); |
|
26 | +if ('approved' === wp_get_comment_status($comment) && $comment->comment_post_ID > 0) : |
|
27 | + $comment_link = get_comment_link($comment); |
|
28 | 28 | ?> |
29 | 29 | <div class="inside"> |
30 | 30 | <div id="comment-link-box"> |
31 | - <strong><?php _ex( 'Permalink:', 'comment' ); ?></strong> |
|
31 | + <strong><?php _ex('Permalink:', 'comment'); ?></strong> |
|
32 | 32 | <span id="sample-permalink"><a href="<?php echo $comment_link; ?>"><?php echo $comment_link; ?></a></span> |
33 | 33 | </div> |
34 | 34 | </div> |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | <div id="namediv" class="stuffbox"> |
37 | 37 | <div class="inside"> |
38 | 38 | <fieldset> |
39 | -<legend class="edit-comment-author"><?php _e( 'Author' ) ?></legend> |
|
39 | +<legend class="edit-comment-author"><?php _e('Author') ?></legend> |
|
40 | 40 | <table class="form-table editcomment"> |
41 | 41 | <tbody> |
42 | 42 | <tr> |
43 | - <td class="first"><label for="name"><?php _e( 'Name:' ); ?></label></td> |
|
44 | - <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td> |
|
43 | + <td class="first"><label for="name"><?php _e('Name:'); ?></label></td> |
|
44 | + <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr($comment->comment_author); ?>" id="name" /></td> |
|
45 | 45 | </tr> |
46 | 46 | <tr> |
47 | - <td class="first"><label for="email"><?php _e( 'Email:' ); ?></label></td> |
|
47 | + <td class="first"><label for="email"><?php _e('Email:'); ?></label></td> |
|
48 | 48 | <td> |
49 | 49 | <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" /> |
50 | 50 | </td> |
51 | 51 | </tr> |
52 | 52 | <tr> |
53 | - <td class="first"><label for="newcomment_author_url"><?php _e( 'URL:' ); ?></label></td> |
|
53 | + <td class="first"><label for="newcomment_author_url"><?php _e('URL:'); ?></label></td> |
|
54 | 54 | <td> |
55 | 55 | <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" /> |
56 | 56 | </td> |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | |
65 | 65 | <div id="postdiv" class="postarea"> |
66 | 66 | <?php |
67 | - echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>'; |
|
68 | - $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); |
|
69 | - wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) ); |
|
70 | - wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> |
|
67 | + echo '<label for="content" class="screen-reader-text">'.__('Comment').'</label>'; |
|
68 | + $quicktags_settings = array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'); |
|
69 | + wp_editor($comment->comment_content, 'content', array('media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings)); |
|
70 | + wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> |
|
71 | 71 | </div> |
72 | 72 | </div><!-- /post-body-content --> |
73 | 73 | |
74 | 74 | <div id="postbox-container-1" class="postbox-container"> |
75 | 75 | <div id="submitdiv" class="stuffbox" > |
76 | -<h2><?php _e( 'Status' ) ?></h2> |
|
76 | +<h2><?php _e('Status') ?></h2> |
|
77 | 77 | <div class="inside"> |
78 | 78 | <div class="submitbox" id="submitcomment"> |
79 | 79 | <div id="minor-publishing"> |
@@ -81,61 +81,61 @@ discard block |
||
81 | 81 | <div id="misc-publishing-actions"> |
82 | 82 | |
83 | 83 | <fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio"> |
84 | -<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend> |
|
85 | -<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br /> |
|
86 | -<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br /> |
|
87 | -<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label> |
|
84 | +<legend class="screen-reader-text"><?php _e('Comment status'); ?></legend> |
|
85 | +<label class="approved"><input type="radio"<?php checked($comment->comment_approved, '1'); ?> name="comment_status" value="1" /><?php _ex('Approved', 'comment status'); ?></label><br /> |
|
86 | +<label class="waiting"><input type="radio"<?php checked($comment->comment_approved, '0'); ?> name="comment_status" value="0" /><?php _ex('Pending', 'comment status'); ?></label><br /> |
|
87 | +<label class="spam"><input type="radio"<?php checked($comment->comment_approved, 'spam'); ?> name="comment_status" value="spam" /><?php _ex('Spam', 'comment status'); ?></label> |
|
88 | 88 | </fieldset> |
89 | 89 | |
90 | 90 | <div class="misc-pub-section curtime misc-pub-curtime"> |
91 | 91 | <?php |
92 | 92 | /* translators: Publish box date format, see http://php.net/date */ |
93 | -$datef = __( 'M j, Y @ H:i' ); |
|
93 | +$datef = __('M j, Y @ H:i'); |
|
94 | 94 | ?> |
95 | 95 | <span id="timestamp"><?php |
96 | 96 | printf( |
97 | 97 | /* translators: %s: comment date */ |
98 | - __( 'Submitted on: %s' ), |
|
99 | - '<b>' . date_i18n( $datef, strtotime( $comment->comment_date ) ) . '</b>' |
|
98 | + __('Submitted on: %s'), |
|
99 | + '<b>'.date_i18n($datef, strtotime($comment->comment_date)).'</b>' |
|
100 | 100 | ); |
101 | 101 | ?></span> |
102 | -<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> |
|
102 | +<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e('Edit'); ?></span> <span class="screen-reader-text"><?php _e('Edit date and time'); ?></span></a> |
|
103 | 103 | <fieldset id='timestampdiv' class='hide-if-js'> |
104 | -<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend> |
|
105 | -<?php touch_time( ( 'editcomment' === $action ), 0 ); ?> |
|
104 | +<legend class="screen-reader-text"><?php _e('Date and time'); ?></legend> |
|
105 | +<?php touch_time(('editcomment' === $action), 0); ?> |
|
106 | 106 | </fieldset> |
107 | 107 | </div> |
108 | 108 | |
109 | 109 | <?php |
110 | 110 | $post_id = $comment->comment_post_ID; |
111 | -if ( current_user_can( 'edit_post', $post_id ) ) { |
|
112 | - $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>"; |
|
113 | - $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>'; |
|
111 | +if (current_user_can('edit_post', $post_id)) { |
|
112 | + $post_link = "<a href='".esc_url(get_edit_post_link($post_id))."'>"; |
|
113 | + $post_link .= esc_html(get_the_title($post_id)).'</a>'; |
|
114 | 114 | } else { |
115 | - $post_link = esc_html( get_the_title( $post_id ) ); |
|
115 | + $post_link = esc_html(get_the_title($post_id)); |
|
116 | 116 | } |
117 | 117 | ?> |
118 | 118 | |
119 | 119 | <div class="misc-pub-section misc-pub-response-to"> |
120 | 120 | <?php printf( |
121 | 121 | /* translators: %s: post link */ |
122 | - __( 'In response to: %s' ), |
|
123 | - '<b>' . $post_link . '</b>' |
|
122 | + __('In response to: %s'), |
|
123 | + '<b>'.$post_link.'</b>' |
|
124 | 124 | ); ?> |
125 | 125 | </div> |
126 | 126 | |
127 | 127 | <?php |
128 | -if ( $comment->comment_parent ) : |
|
129 | - $parent = get_comment( $comment->comment_parent ); |
|
130 | - if ( $parent ) : |
|
131 | - $parent_link = esc_url( get_comment_link( $parent ) ); |
|
132 | - $name = get_comment_author( $parent ); |
|
128 | +if ($comment->comment_parent) : |
|
129 | + $parent = get_comment($comment->comment_parent); |
|
130 | + if ($parent) : |
|
131 | + $parent_link = esc_url(get_comment_link($parent)); |
|
132 | + $name = get_comment_author($parent); |
|
133 | 133 | ?> |
134 | 134 | <div class="misc-pub-section misc-pub-reply-to"> |
135 | 135 | <?php printf( |
136 | 136 | /* translators: %s: comment link */ |
137 | - __( 'In reply to: %s' ), |
|
138 | - '<b><a href="' . $parent_link . '">' . $name . '</a></b>' |
|
137 | + __('In reply to: %s'), |
|
138 | + '<b><a href="'.$parent_link.'">'.$name.'</a></b>' |
|
139 | 139 | ); ?> |
140 | 140 | </div> |
141 | 141 | <?php endif; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @param string $html Output HTML to display miscellaneous action. |
151 | 151 | * @param object $comment Current comment object. |
152 | 152 | */ |
153 | - echo apply_filters( 'edit_comment_misc_actions', '', $comment ); |
|
153 | + echo apply_filters('edit_comment_misc_actions', '', $comment); |
|
154 | 154 | ?> |
155 | 155 | |
156 | 156 | </div> <!-- misc actions --> |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | |
160 | 160 | <div id="major-publishing-actions"> |
161 | 161 | <div id="delete-action"> |
162 | -<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?> |
|
162 | +<?php echo "<a class='submitdelete deletion' href='".wp_nonce_url("comment.php?action=".( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment')."&c=$comment->comment_ID&_wp_original_http_referer=".urlencode(wp_get_referer()), 'delete-comment_'.$comment->comment_ID)."'>".( ! EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash'))."</a>\n"; ?> |
|
163 | 163 | </div> |
164 | 164 | <div id="publishing-action"> |
165 | -<?php submit_button( __( 'Update' ), 'primary', 'save', false ); ?> |
|
165 | +<?php submit_button(__('Update'), 'primary', 'save', false); ?> |
|
166 | 166 | </div> |
167 | 167 | <div class="clear"></div> |
168 | 168 | </div> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | <div id="postbox-container-2" class="postbox-container"> |
175 | 175 | <?php |
176 | 176 | /** This action is documented in wp-admin/edit-form-advanced.php */ |
177 | -do_action( 'add_meta_boxes', 'comment', $comment ); |
|
177 | +do_action('add_meta_boxes', 'comment', $comment); |
|
178 | 178 | |
179 | 179 | /** |
180 | 180 | * Fires when comment-specific meta boxes are added. |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param WP_Comment $comment Comment object. |
185 | 185 | */ |
186 | -do_action( 'add_meta_boxes_comment', $comment ); |
|
186 | +do_action('add_meta_boxes_comment', $comment); |
|
187 | 187 | |
188 | 188 | do_meta_boxes(null, 'normal', $comment); |
189 | 189 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | <input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" /> |
195 | 195 | <input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" /> |
196 | -<input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" /> |
|
196 | +<input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url($referer) : ''; ?>" /> |
|
197 | 197 | <?php wp_original_referer_field(true, 'previous'); ?> |
198 | 198 | <input type="hidden" name="noredir" value="1" /> |
199 | 199 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | </div> |
203 | 203 | </form> |
204 | 204 | |
205 | -<?php if ( ! wp_is_mobile() ) : ?> |
|
205 | +<?php if ( ! wp_is_mobile()) : ?> |
|
206 | 206 | <script type="text/javascript"> |
207 | 207 | try{document.post.name.focus();}catch(e){} |
208 | 208 | </script> |
@@ -14,19 +14,22 @@ discard block |
||
14 | 14 | define( 'WP_ADMIN', true ); |
15 | 15 | } |
16 | 16 | |
17 | -if ( defined('ABSPATH') ) |
|
17 | +if ( defined('ABSPATH') ) { |
|
18 | 18 | require_once(ABSPATH . 'wp-load.php'); |
19 | -else |
|
19 | +} else { |
|
20 | 20 | require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
21 | +} |
|
21 | 22 | |
22 | 23 | if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['action'] ) ) { |
23 | 24 | // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead |
24 | - if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) |
|
25 | - $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
|
26 | - elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) |
|
27 | - $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
|
28 | - if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) |
|
29 | - $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; |
|
25 | + if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) { |
|
26 | + $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
|
27 | + } elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) { |
|
28 | + $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
|
29 | + } |
|
30 | + if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) { |
|
31 | + $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; |
|
32 | + } |
|
30 | 33 | unset($current_user); |
31 | 34 | } |
32 | 35 | |
@@ -51,15 +54,18 @@ discard block |
||
51 | 54 | // just fetch the detail form for that attachment |
52 | 55 | if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { |
53 | 56 | $post = get_post( $id ); |
54 | - if ( 'attachment' != $post->post_type ) |
|
55 | - wp_die( __( 'Unknown post type.' ) ); |
|
56 | - if ( ! current_user_can( 'edit_post', $id ) ) |
|
57 | - wp_die( __( 'You are not allowed to edit this item.' ) ); |
|
57 | + if ( 'attachment' != $post->post_type ) { |
|
58 | + wp_die( __( 'Unknown post type.' ) ); |
|
59 | + } |
|
60 | + if ( ! current_user_can( 'edit_post', $id ) ) { |
|
61 | + wp_die( __( 'You are not allowed to edit this item.' ) ); |
|
62 | + } |
|
58 | 63 | |
59 | 64 | switch ( $_REQUEST['fetch'] ) { |
60 | 65 | case 3 : |
61 | - if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) |
|
62 | - echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; |
|
66 | + if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) { |
|
67 | + echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; |
|
68 | + } |
|
63 | 69 | echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; |
64 | 70 | $title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // Title shouldn't ever be empty, but use filename just in case. |
65 | 71 | echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</span></div>'; |
@@ -81,9 +87,10 @@ discard block |
||
81 | 87 | $post_id = 0; |
82 | 88 | if ( isset( $_REQUEST['post_id'] ) ) { |
83 | 89 | $post_id = absint( $_REQUEST['post_id'] ); |
84 | - if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) |
|
85 | - $post_id = 0; |
|
86 | -} |
|
90 | + if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) { |
|
91 | + $post_id = 0; |
|
92 | + } |
|
93 | + } |
|
87 | 94 | |
88 | 95 | $id = media_handle_upload( 'async-upload', $post_id ); |
89 | 96 | if ( is_wp_error($id) ) { |
@@ -6,70 +6,70 @@ discard block |
||
6 | 6 | * @subpackage Administration |
7 | 7 | */ |
8 | 8 | |
9 | -if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { |
|
10 | - define( 'DOING_AJAX', true ); |
|
9 | +if (isset($_REQUEST['action']) && 'upload-attachment' === $_REQUEST['action']) { |
|
10 | + define('DOING_AJAX', true); |
|
11 | 11 | } |
12 | 12 | |
13 | -if ( ! defined( 'WP_ADMIN' ) ) { |
|
14 | - define( 'WP_ADMIN', true ); |
|
13 | +if ( ! defined('WP_ADMIN')) { |
|
14 | + define('WP_ADMIN', true); |
|
15 | 15 | } |
16 | 16 | |
17 | -if ( defined('ABSPATH') ) |
|
18 | - require_once(ABSPATH . 'wp-load.php'); |
|
17 | +if (defined('ABSPATH')) |
|
18 | + require_once(ABSPATH.'wp-load.php'); |
|
19 | 19 | else |
20 | - require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
|
20 | + require_once(dirname(dirname(__FILE__)).'/wp-load.php'); |
|
21 | 21 | |
22 | -if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['action'] ) ) { |
|
22 | +if ( ! (isset($_REQUEST['action']) && 'upload-attachment' == $_REQUEST['action'])) { |
|
23 | 23 | // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead |
24 | - if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) |
|
24 | + if (is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && ! empty($_REQUEST['auth_cookie'])) |
|
25 | 25 | $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
26 | - elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) |
|
26 | + elseif (empty($_COOKIE[AUTH_COOKIE]) && ! empty($_REQUEST['auth_cookie'])) |
|
27 | 27 | $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; |
28 | - if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) |
|
28 | + if (empty($_COOKIE[LOGGED_IN_COOKIE]) && ! empty($_REQUEST['logged_in_cookie'])) |
|
29 | 29 | $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; |
30 | 30 | unset($current_user); |
31 | 31 | } |
32 | 32 | |
33 | -require_once( ABSPATH . 'wp-admin/admin.php' ); |
|
33 | +require_once(ABSPATH.'wp-admin/admin.php'); |
|
34 | 34 | |
35 | -header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); |
|
35 | +header('Content-Type: text/html; charset='.get_option('blog_charset')); |
|
36 | 36 | |
37 | -if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { |
|
38 | - include( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); |
|
37 | +if (isset($_REQUEST['action']) && 'upload-attachment' === $_REQUEST['action']) { |
|
38 | + include(ABSPATH.'wp-admin/includes/ajax-actions.php'); |
|
39 | 39 | |
40 | 40 | send_nosniff_header(); |
41 | 41 | nocache_headers(); |
42 | 42 | |
43 | 43 | wp_ajax_upload_attachment(); |
44 | - die( '0' ); |
|
44 | + die('0'); |
|
45 | 45 | } |
46 | 46 | |
47 | -if ( ! current_user_can( 'upload_files' ) ) { |
|
48 | - wp_die( __( 'You do not have permission to upload files.' ) ); |
|
47 | +if ( ! current_user_can('upload_files')) { |
|
48 | + wp_die(__('You do not have permission to upload files.')); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // just fetch the detail form for that attachment |
52 | -if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { |
|
53 | - $post = get_post( $id ); |
|
54 | - if ( 'attachment' != $post->post_type ) |
|
55 | - wp_die( __( 'Unknown post type.' ) ); |
|
56 | - if ( ! current_user_can( 'edit_post', $id ) ) |
|
57 | - wp_die( __( 'You are not allowed to edit this item.' ) ); |
|
58 | - |
|
59 | - switch ( $_REQUEST['fetch'] ) { |
|
52 | +if (isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch']) { |
|
53 | + $post = get_post($id); |
|
54 | + if ('attachment' != $post->post_type) |
|
55 | + wp_die(__('Unknown post type.')); |
|
56 | + if ( ! current_user_can('edit_post', $id)) |
|
57 | + wp_die(__('You are not allowed to edit this item.')); |
|
58 | + |
|
59 | + switch ($_REQUEST['fetch']) { |
|
60 | 60 | case 3 : |
61 | - if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) |
|
62 | - echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; |
|
63 | - echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; |
|
61 | + if ($thumb_url = wp_get_attachment_image_src($id, 'thumbnail', true)) |
|
62 | + echo '<img class="pinkynail" src="'.esc_url($thumb_url[0]).'" alt="" />'; |
|
63 | + echo '<a class="edit-attachment" href="'.esc_url(get_edit_post_link($id)).'" target="_blank">'._x('Edit', 'media item').'</a>'; |
|
64 | 64 | |
65 | 65 | // Title shouldn't ever be empty, but use filename just in case. |
66 | - $file = get_attached_file( $post->ID ); |
|
67 | - $title = $post->post_title ? $post->post_title : wp_basename( $file ); |
|
68 | - echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</span></div>'; |
|
66 | + $file = get_attached_file($post->ID); |
|
67 | + $title = $post->post_title ? $post->post_title : wp_basename($file); |
|
68 | + echo '<div class="filename new"><span class="title">'.esc_html(wp_html_excerpt($title, 60, '…')).'</span></div>'; |
|
69 | 69 | break; |
70 | 70 | case 2 : |
71 | 71 | add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); |
72 | - echo get_media_item($id, array( 'send' => false, 'delete' => true )); |
|
72 | + echo get_media_item($id, array('send' => false, 'delete' => true)); |
|
73 | 73 | break; |
74 | 74 | default: |
75 | 75 | add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); |
@@ -82,22 +82,22 @@ discard block |
||
82 | 82 | check_admin_referer('media-form'); |
83 | 83 | |
84 | 84 | $post_id = 0; |
85 | -if ( isset( $_REQUEST['post_id'] ) ) { |
|
86 | - $post_id = absint( $_REQUEST['post_id'] ); |
|
87 | - if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) |
|
85 | +if (isset($_REQUEST['post_id'])) { |
|
86 | + $post_id = absint($_REQUEST['post_id']); |
|
87 | + if ( ! get_post($post_id) || ! current_user_can('edit_post', $post_id)) |
|
88 | 88 | $post_id = 0; |
89 | 89 | } |
90 | 90 | |
91 | -$id = media_handle_upload( 'async-upload', $post_id ); |
|
92 | -if ( is_wp_error($id) ) { |
|
91 | +$id = media_handle_upload('async-upload', $post_id); |
|
92 | +if (is_wp_error($id)) { |
|
93 | 93 | echo '<div class="error-div error"> |
94 | - <a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __('Dismiss') . '</a> |
|
95 | - <strong>' . sprintf(__('“%s” has failed to upload.'), esc_html($_FILES['async-upload']['name']) ) . '</strong><br />' . |
|
96 | - esc_html($id->get_error_message()) . '</div>'; |
|
94 | + <a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __('Dismiss').'</a> |
|
95 | + <strong>' . sprintf(__('“%s” has failed to upload.'), esc_html($_FILES['async-upload']['name'])).'</strong><br />'. |
|
96 | + esc_html($id->get_error_message()).'</div>'; |
|
97 | 97 | exit; |
98 | 98 | } |
99 | 99 | |
100 | -if ( $_REQUEST['short'] ) { |
|
100 | +if ($_REQUEST['short']) { |
|
101 | 101 | // Short form response - attachment ID only. |
102 | 102 | echo $id; |
103 | 103 | } else { |
@@ -114,5 +114,5 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @param int $id Uploaded attachment ID. |
116 | 116 | */ |
117 | - echo apply_filters( "async_upload_{$type}", $id ); |
|
117 | + echo apply_filters("async_upload_{$type}", $id); |
|
118 | 118 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Media settings administration panel. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * Media settings administration panel. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -9,8 +9,9 @@ |
||
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | |
12 | -if ( ! current_user_can( 'manage_options' ) ) |
|
12 | +if ( ! current_user_can( 'manage_options' ) ) { |
|
13 | 13 | wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); |
14 | +} |
|
14 | 15 | |
15 | 16 | $title = __('Media Settings'); |
16 | 17 | $parent_file = 'options-general.php'; |
@@ -7,46 +7,46 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | -if ( ! current_user_can( 'manage_options' ) ) |
|
13 | - wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); |
|
12 | +if ( ! current_user_can('manage_options')) |
|
13 | + wp_die(__('You do not have sufficient permissions to manage options for this site.')); |
|
14 | 14 | |
15 | 15 | $title = __('Media Settings'); |
16 | 16 | $parent_file = 'options-general.php'; |
17 | 17 | |
18 | -$media_options_help = '<p>' . __('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.') . '</p>'; |
|
18 | +$media_options_help = '<p>'.__('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.').'</p>'; |
|
19 | 19 | |
20 | -if ( ! is_multisite() && ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) ) { |
|
21 | - $media_options_help .= '<p>' . __('Uploading Files allows you to choose the folder and path for storing your uploaded files.') . '</p>'; |
|
20 | +if ( ! is_multisite() && (get_option('upload_url_path') || (get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path')))) { |
|
21 | + $media_options_help .= '<p>'.__('Uploading Files allows you to choose the folder and path for storing your uploaded files.').'</p>'; |
|
22 | 22 | } |
23 | 23 | |
24 | -$media_options_help .= '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>'; |
|
24 | +$media_options_help .= '<p>'.__('You must click the Save Changes button at the bottom of the screen for new settings to take effect.').'</p>'; |
|
25 | 25 | |
26 | -get_current_screen()->add_help_tab( array( |
|
26 | +get_current_screen()->add_help_tab(array( |
|
27 | 27 | 'id' => 'overview', |
28 | 28 | 'title' => __('Overview'), |
29 | 29 | 'content' => $media_options_help, |
30 | -) ); |
|
30 | +)); |
|
31 | 31 | |
32 | 32 | get_current_screen()->set_help_sidebar( |
33 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
34 | - '<p>' . __('<a href="https://codex.wordpress.org/Settings_Media_Screen" target="_blank">Documentation on Media Settings</a>') . '</p>' . |
|
35 | - '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
|
33 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
34 | + '<p>'.__('<a href="https://codex.wordpress.org/Settings_Media_Screen" target="_blank">Documentation on Media Settings</a>').'</p>'. |
|
35 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
36 | 36 | ); |
37 | 37 | |
38 | -include( ABSPATH . 'wp-admin/admin-header.php' ); |
|
38 | +include(ABSPATH.'wp-admin/admin-header.php'); |
|
39 | 39 | |
40 | 40 | ?> |
41 | 41 | |
42 | 42 | <div class="wrap"> |
43 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
43 | +<h1><?php echo esc_html($title); ?></h1> |
|
44 | 44 | |
45 | 45 | <form action="options.php" method="post"> |
46 | 46 | <?php settings_fields('media'); ?> |
47 | 47 | |
48 | 48 | <h2 class="title"><?php _e('Image sizes') ?></h2> |
49 | -<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p> |
|
49 | +<p><?php _e('The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.'); ?></p> |
|
50 | 50 | |
51 | 51 | <table class="form-table"> |
52 | 52 | <tr> |
@@ -88,33 +88,33 @@ discard block |
||
88 | 88 | /** |
89 | 89 | * @global array $wp_settings |
90 | 90 | */ |
91 | -if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?> |
|
91 | +if (isset($GLOBALS['wp_settings']['media']['embeds'])) : ?> |
|
92 | 92 | <h2 class="title"><?php _e('Embeds') ?></h2> |
93 | 93 | <table class="form-table"> |
94 | -<?php do_settings_fields( 'media', 'embeds' ); ?> |
|
94 | +<?php do_settings_fields('media', 'embeds'); ?> |
|
95 | 95 | </table> |
96 | 96 | <?php endif; ?> |
97 | 97 | |
98 | -<?php if ( !is_multisite() ) : ?> |
|
98 | +<?php if ( ! is_multisite()) : ?> |
|
99 | 99 | <h2 class="title"><?php _e('Uploading Files'); ?></h2> |
100 | 100 | <table class="form-table"> |
101 | 101 | <?php |
102 | 102 | // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty) |
103 | -if ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) : |
|
103 | +if (get_option('upload_url_path') || (get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path'))) : |
|
104 | 104 | ?> |
105 | 105 | <tr> |
106 | 106 | <th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th> |
107 | 107 | <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" /> |
108 | 108 | <p class="description"><?php |
109 | 109 | /* translators: %s: wp-content/uploads */ |
110 | - printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' ); |
|
110 | + printf(__('Default is %s'), '<code>wp-content/uploads</code>'); |
|
111 | 111 | ?></p> |
112 | 112 | </td> |
113 | 113 | </tr> |
114 | 114 | |
115 | 115 | <tr> |
116 | 116 | <th scope="row"><label for="upload_url_path"><?php _e('Full URL path to files'); ?></label></th> |
117 | -<td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option('upload_url_path')); ?>" class="regular-text code" /> |
|
117 | +<td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr(get_option('upload_url_path')); ?>" class="regular-text code" /> |
|
118 | 118 | <p class="description"><?php _e('Configuring this is optional. By default, it should be blank.'); ?></p> |
119 | 119 | </td> |
120 | 120 | </tr> |
@@ -140,4 +140,4 @@ discard block |
||
140 | 140 | |
141 | 141 | </div> |
142 | 142 | |
143 | -<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> |
|
143 | +<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * @since 3.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | -wp_redirect( network_admin_url('upgrade.php') ); |
|
12 | +wp_redirect(network_admin_url('upgrade.php')); |
|
13 | 13 | exit; |
@@ -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 permission to access this page.' ), 403 ); |
19 | +} |
|
18 | 20 | |
19 | 21 | $wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' ); |
20 | 22 | $pagenum = $wp_list_table->get_pagenum(); |
@@ -120,8 +122,9 @@ discard block |
||
120 | 122 | switch ( $_GET['action'] ) { |
121 | 123 | |
122 | 124 | case 'deleteblog': |
123 | - if ( ! current_user_can( 'delete_sites' ) ) |
|
124 | - wp_die( __( 'You do not have permission to access this page.' ), '', array( 'response' => 403 ) ); |
|
125 | + if ( ! current_user_can( 'delete_sites' ) ) { |
|
126 | + wp_die( __( 'You do not have permission to access this page.' ), '', array( 'response' => 403 ) ); |
|
127 | + } |
|
125 | 128 | |
126 | 129 | $updated_action = 'not_deleted'; |
127 | 130 | if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) { |
@@ -138,8 +141,9 @@ discard block |
||
138 | 141 | if ( $val != '0' && $val != $current_site->blog_id ) { |
139 | 142 | switch ( $doaction ) { |
140 | 143 | case 'delete': |
141 | - if ( ! current_user_can( 'delete_site', $val ) ) |
|
142 | - wp_die( __( 'You are not allowed to delete the site.' ) ); |
|
144 | + if ( ! current_user_can( 'delete_site', $val ) ) { |
|
145 | + wp_die( __( 'You are not allowed to delete the site.' ) ); |
|
146 | + } |
|
143 | 147 | |
144 | 148 | $updated_action = 'all_delete'; |
145 | 149 | wpmu_delete_blog( $val, true ); |
@@ -263,9 +267,10 @@ discard block |
||
263 | 267 | break; |
264 | 268 | } |
265 | 269 | |
266 | - if ( ! empty( $msg ) ) |
|
267 | - $msg = '<div class="updated" id="message notice is-dismissible"><p>' . $msg . '</p></div>'; |
|
268 | -} |
|
270 | + if ( ! empty( $msg ) ) { |
|
271 | + $msg = '<div class="updated" id="message notice is-dismissible"><p>' . $msg . '</p></div>'; |
|
272 | + } |
|
273 | + } |
|
269 | 274 | |
270 | 275 | $wp_list_table->prepare_items(); |
271 | 276 |
@@ -8,175 +8,175 @@ 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 permission to access this page.' ), 403 ); |
|
16 | +if ( ! current_user_can('manage_sites')) |
|
17 | + wp_die(__('You do not have permission to access this page.'), 403); |
|
18 | 18 | |
19 | -$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' ); |
|
19 | +$wp_list_table = _get_list_table('WP_MS_Sites_List_Table'); |
|
20 | 20 | $pagenum = $wp_list_table->get_pagenum(); |
21 | 21 | |
22 | -$title = __( 'Sites' ); |
|
22 | +$title = __('Sites'); |
|
23 | 23 | $parent_file = 'sites.php'; |
24 | 24 | |
25 | -add_screen_option( 'per_page' ); |
|
25 | +add_screen_option('per_page'); |
|
26 | 26 | |
27 | -get_current_screen()->add_help_tab( array( |
|
27 | +get_current_screen()->add_help_tab(array( |
|
28 | 28 | 'id' => 'overview', |
29 | 29 | 'title' => __('Overview'), |
30 | 30 | 'content' => |
31 | - '<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' . |
|
32 | - '<p>' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '</p>' . |
|
33 | - '<p>' . __('Hovering over each site reveals seven options (three for the primary site):') . '</p>' . |
|
34 | - '<ul><li>' . __('An Edit link to a separate Edit Site screen.') . '</li>' . |
|
35 | - '<li>' . __('Dashboard leads to the Dashboard for that site.') . '</li>' . |
|
36 | - '<li>' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '</li>' . |
|
37 | - '<li>' . __('Delete which is a permanent action after the confirmation screens.') . '</li>' . |
|
38 | - '<li>' . __('Visit to go to the front-end site live.') . '</li></ul>' . |
|
39 | - '<p>' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '</p>' . |
|
40 | - '<p>' . __('Clicking on bold headings can re-sort this table.') . '</p>' |
|
41 | -) ); |
|
31 | + '<p>'.__('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.').'</p>'. |
|
32 | + '<p>'.__('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.').'</p>'. |
|
33 | + '<p>'.__('Hovering over each site reveals seven options (three for the primary site):').'</p>'. |
|
34 | + '<ul><li>'.__('An Edit link to a separate Edit Site screen.').'</li>'. |
|
35 | + '<li>'.__('Dashboard leads to the Dashboard for that site.').'</li>'. |
|
36 | + '<li>'.__('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.').'</li>'. |
|
37 | + '<li>'.__('Delete which is a permanent action after the confirmation screens.').'</li>'. |
|
38 | + '<li>'.__('Visit to go to the front-end site live.').'</li></ul>'. |
|
39 | + '<p>'.__('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.').'</p>'. |
|
40 | + '<p>'.__('Clicking on bold headings can re-sort this table.').'</p>' |
|
41 | +)); |
|
42 | 42 | |
43 | 43 | get_current_screen()->set_help_sidebar( |
44 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
45 | - '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' . |
|
46 | - '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>' |
|
44 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
45 | + '<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>').'</p>'. |
|
46 | + '<p>'.__('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>').'</p>' |
|
47 | 47 | ); |
48 | 48 | |
49 | -get_current_screen()->set_screen_reader_content( array( |
|
50 | - 'heading_pagination' => __( 'Sites list navigation' ), |
|
51 | - 'heading_list' => __( 'Sites list' ), |
|
52 | -) ); |
|
49 | +get_current_screen()->set_screen_reader_content(array( |
|
50 | + 'heading_pagination' => __('Sites list navigation'), |
|
51 | + 'heading_list' => __('Sites list'), |
|
52 | +)); |
|
53 | 53 | |
54 | -$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
|
54 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
55 | 55 | |
56 | -if ( isset( $_GET['action'] ) ) { |
|
56 | +if (isset($_GET['action'])) { |
|
57 | 57 | /** This action is documented in wp-admin/network/edit.php */ |
58 | - do_action( 'wpmuadminedit' ); |
|
58 | + do_action('wpmuadminedit'); |
|
59 | 59 | |
60 | 60 | // A list of valid actions and their associated messaging for confirmation output. |
61 | 61 | $manage_actions = array( |
62 | - 'activateblog' => __( 'You are about to activate the site %s.' ), |
|
63 | - 'deactivateblog' => __( 'You are about to deactivate the site %s.' ), |
|
64 | - 'unarchiveblog' => __( 'You are about to unarchive the site %s.' ), |
|
65 | - 'archiveblog' => __( 'You are about to archive the site %s.' ), |
|
66 | - 'unspamblog' => __( 'You are about to unspam the site %s.' ), |
|
67 | - 'spamblog' => __( 'You are about to mark the site %s as spam.' ), |
|
68 | - 'deleteblog' => __( 'You are about to delete the site %s.' ), |
|
69 | - 'unmatureblog' => __( 'You are about to mark the site %s as mature.' ), |
|
70 | - 'matureblog' => __( 'You are about to mark the site %s as not mature.' ), |
|
62 | + 'activateblog' => __('You are about to activate the site %s.'), |
|
63 | + 'deactivateblog' => __('You are about to deactivate the site %s.'), |
|
64 | + 'unarchiveblog' => __('You are about to unarchive the site %s.'), |
|
65 | + 'archiveblog' => __('You are about to archive the site %s.'), |
|
66 | + 'unspamblog' => __('You are about to unspam the site %s.'), |
|
67 | + 'spamblog' => __('You are about to mark the site %s as spam.'), |
|
68 | + 'deleteblog' => __('You are about to delete the site %s.'), |
|
69 | + 'unmatureblog' => __('You are about to mark the site %s as mature.'), |
|
70 | + 'matureblog' => __('You are about to mark the site %s as not mature.'), |
|
71 | 71 | ); |
72 | 72 | |
73 | - if ( 'confirm' === $_GET['action'] ) { |
|
73 | + if ('confirm' === $_GET['action']) { |
|
74 | 74 | // The action2 parameter contains the action being taken on the site. |
75 | 75 | $site_action = $_GET['action2']; |
76 | 76 | |
77 | - if ( ! array_key_exists( $site_action, $manage_actions ) ) { |
|
78 | - wp_die( __( 'The requested action is not valid.' ) ); |
|
77 | + if ( ! array_key_exists($site_action, $manage_actions)) { |
|
78 | + wp_die(__('The requested action is not valid.')); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility. |
82 | - if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) { |
|
83 | - check_admin_referer( 'confirm' ); |
|
82 | + if ('matureblog' === $site_action || 'unmatureblog' === $site_action) { |
|
83 | + check_admin_referer('confirm'); |
|
84 | 84 | } else { |
85 | - check_admin_referer( $site_action . '_' . $id ); |
|
85 | + check_admin_referer($site_action.'_'.$id); |
|
86 | 86 | } |
87 | 87 | |
88 | - if ( ! headers_sent() ) { |
|
88 | + if ( ! headers_sent()) { |
|
89 | 89 | nocache_headers(); |
90 | - header( 'Content-Type: text/html; charset=utf-8' ); |
|
90 | + header('Content-Type: text/html; charset=utf-8'); |
|
91 | 91 | } |
92 | 92 | |
93 | - if ( $current_site->blog_id == $id ) { |
|
94 | - wp_die( __( 'You are not allowed to change the current site.' ) ); |
|
93 | + if ($current_site->blog_id == $id) { |
|
94 | + wp_die(__('You are not allowed to change the current site.')); |
|
95 | 95 | } |
96 | 96 | |
97 | - $site_details = get_blog_details( $id ); |
|
98 | - $site_address = untrailingslashit( $site_details->domain . $site_details->path ); |
|
97 | + $site_details = get_blog_details($id); |
|
98 | + $site_address = untrailingslashit($site_details->domain.$site_details->path); |
|
99 | 99 | |
100 | - require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
100 | + require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
101 | 101 | ?> |
102 | 102 | <div class="wrap"> |
103 | - <h1><?php _e( 'Confirm your action' ); ?></h1> |
|
104 | - <form action="sites.php?action=<?php echo esc_attr( $site_action ); ?>" method="post"> |
|
105 | - <input type="hidden" name="action" value="<?php echo esc_attr( $site_action ); ?>" /> |
|
106 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" /> |
|
107 | - <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" /> |
|
108 | - <?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?> |
|
109 | - <p><?php echo sprintf( $manage_actions[ $site_action ], $site_address ); ?></p> |
|
110 | - <?php submit_button( __( 'Confirm' ), 'primary' ); ?> |
|
103 | + <h1><?php _e('Confirm your action'); ?></h1> |
|
104 | + <form action="sites.php?action=<?php echo esc_attr($site_action); ?>" method="post"> |
|
105 | + <input type="hidden" name="action" value="<?php echo esc_attr($site_action); ?>" /> |
|
106 | + <input type="hidden" name="id" value="<?php echo esc_attr($id); ?>" /> |
|
107 | + <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr(wp_get_referer()); ?>" /> |
|
108 | + <?php wp_nonce_field($site_action.'_'.$id, '_wpnonce', false); ?> |
|
109 | + <p><?php echo sprintf($manage_actions[$site_action], $site_address); ?></p> |
|
110 | + <?php submit_button(__('Confirm'), 'primary'); ?> |
|
111 | 111 | </form> |
112 | 112 | </div> |
113 | 113 | <?php |
114 | - require_once( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
114 | + require_once(ABSPATH.'wp-admin/admin-footer.php'); |
|
115 | 115 | exit(); |
116 | - } elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) { |
|
116 | + } elseif (array_key_exists($_GET['action'], $manage_actions)) { |
|
117 | 117 | $action = $_GET['action']; |
118 | - check_admin_referer( $action . '_' . $id ); |
|
119 | - } elseif ( 'allblogs' === $_GET['action'] ) { |
|
120 | - check_admin_referer( 'bulk-sites' ); |
|
118 | + check_admin_referer($action.'_'.$id); |
|
119 | + } elseif ('allblogs' === $_GET['action']) { |
|
120 | + check_admin_referer('bulk-sites'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | $updated_action = ''; |
124 | 124 | |
125 | - switch ( $_GET['action'] ) { |
|
125 | + switch ($_GET['action']) { |
|
126 | 126 | |
127 | 127 | case 'deleteblog': |
128 | - if ( ! current_user_can( 'delete_sites' ) ) |
|
129 | - wp_die( __( 'You do not have permission to access this page.' ), '', array( 'response' => 403 ) ); |
|
128 | + if ( ! current_user_can('delete_sites')) |
|
129 | + wp_die(__('You do not have permission to access this page.'), '', array('response' => 403)); |
|
130 | 130 | |
131 | 131 | $updated_action = 'not_deleted'; |
132 | - if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) { |
|
133 | - wpmu_delete_blog( $id, true ); |
|
132 | + if ($id != '0' && $id != $current_site->blog_id && current_user_can('delete_site', $id)) { |
|
133 | + wpmu_delete_blog($id, true); |
|
134 | 134 | $updated_action = 'delete'; |
135 | 135 | } |
136 | 136 | break; |
137 | 137 | |
138 | 138 | case 'allblogs': |
139 | - if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allblogs'] ) ) { |
|
139 | + if ((isset($_POST['action']) || isset($_POST['action2'])) && isset($_POST['allblogs'])) { |
|
140 | 140 | $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2']; |
141 | 141 | |
142 | - foreach ( (array) $_POST['allblogs'] as $key => $val ) { |
|
143 | - if ( $val != '0' && $val != $current_site->blog_id ) { |
|
144 | - switch ( $doaction ) { |
|
142 | + foreach ((array) $_POST['allblogs'] as $key => $val) { |
|
143 | + if ($val != '0' && $val != $current_site->blog_id) { |
|
144 | + switch ($doaction) { |
|
145 | 145 | case 'delete': |
146 | - if ( ! current_user_can( 'delete_site', $val ) ) |
|
147 | - wp_die( __( 'You are not allowed to delete the site.' ) ); |
|
146 | + if ( ! current_user_can('delete_site', $val)) |
|
147 | + wp_die(__('You are not allowed to delete the site.')); |
|
148 | 148 | |
149 | 149 | $updated_action = 'all_delete'; |
150 | - wpmu_delete_blog( $val, true ); |
|
150 | + wpmu_delete_blog($val, true); |
|
151 | 151 | break; |
152 | 152 | |
153 | 153 | case 'spam': |
154 | 154 | case 'notspam': |
155 | - $updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam'; |
|
156 | - update_blog_status( $val, 'spam', ( 'spam' === $doaction ) ? '1' : '0' ); |
|
155 | + $updated_action = ('spam' === $doaction) ? 'all_spam' : 'all_notspam'; |
|
156 | + update_blog_status($val, 'spam', ('spam' === $doaction) ? '1' : '0'); |
|
157 | 157 | break; |
158 | 158 | } |
159 | 159 | } else { |
160 | - wp_die( __( 'You are not allowed to change the current site.' ) ); |
|
160 | + wp_die(__('You are not allowed to change the current site.')); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | } else { |
164 | - $location = network_admin_url( 'sites.php' ); |
|
165 | - if ( ! empty( $_REQUEST['paged'] ) ) { |
|
166 | - $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); |
|
164 | + $location = network_admin_url('sites.php'); |
|
165 | + if ( ! empty($_REQUEST['paged'])) { |
|
166 | + $location = add_query_arg('paged', (int) $_REQUEST['paged'], $location); |
|
167 | 167 | } |
168 | - wp_redirect( $location ); |
|
168 | + wp_redirect($location); |
|
169 | 169 | exit(); |
170 | 170 | } |
171 | 171 | break; |
172 | 172 | |
173 | 173 | case 'archiveblog': |
174 | 174 | case 'unarchiveblog': |
175 | - update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' ); |
|
175 | + update_blog_status($id, 'archived', ('archiveblog' === $_GET['action']) ? '1' : '0'); |
|
176 | 176 | break; |
177 | 177 | |
178 | 178 | case 'activateblog': |
179 | - update_blog_status( $id, 'deleted', '0' ); |
|
179 | + update_blog_status($id, 'deleted', '0'); |
|
180 | 180 | |
181 | 181 | /** |
182 | 182 | * Fires after a network site is activated. |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @param string $id The ID of the activated site. |
187 | 187 | */ |
188 | - do_action( 'activate_blog', $id ); |
|
188 | + do_action('activate_blog', $id); |
|
189 | 189 | break; |
190 | 190 | |
191 | 191 | case 'deactivateblog': |
@@ -196,66 +196,66 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @param string $id The ID of the site being deactivated. |
198 | 198 | */ |
199 | - do_action( 'deactivate_blog', $id ); |
|
200 | - update_blog_status( $id, 'deleted', '1' ); |
|
199 | + do_action('deactivate_blog', $id); |
|
200 | + update_blog_status($id, 'deleted', '1'); |
|
201 | 201 | break; |
202 | 202 | |
203 | 203 | case 'unspamblog': |
204 | 204 | case 'spamblog': |
205 | - update_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' ); |
|
205 | + update_blog_status($id, 'spam', ('spamblog' === $_GET['action']) ? '1' : '0'); |
|
206 | 206 | break; |
207 | 207 | |
208 | 208 | case 'unmatureblog': |
209 | 209 | case 'matureblog': |
210 | - update_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' ); |
|
210 | + update_blog_status($id, 'mature', ('matureblog' === $_GET['action']) ? '1' : '0'); |
|
211 | 211 | break; |
212 | 212 | } |
213 | 213 | |
214 | - if ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) { |
|
214 | + if (empty($updated_action) && array_key_exists($_GET['action'], $manage_actions)) { |
|
215 | 215 | $updated_action = $_GET['action']; |
216 | 216 | } |
217 | 217 | |
218 | - if ( ! empty( $updated_action ) ) { |
|
219 | - wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) ); |
|
218 | + if ( ! empty($updated_action)) { |
|
219 | + wp_safe_redirect(add_query_arg(array('updated' => $updated_action), wp_get_referer())); |
|
220 | 220 | exit(); |
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | 224 | $msg = ''; |
225 | -if ( isset( $_GET['updated'] ) ) { |
|
226 | - switch ( $_GET['updated'] ) { |
|
225 | +if (isset($_GET['updated'])) { |
|
226 | + switch ($_GET['updated']) { |
|
227 | 227 | case 'all_notspam': |
228 | - $msg = __( 'Sites removed from spam.' ); |
|
228 | + $msg = __('Sites removed from spam.'); |
|
229 | 229 | break; |
230 | 230 | case 'all_spam': |
231 | - $msg = __( 'Sites marked as spam.' ); |
|
231 | + $msg = __('Sites marked as spam.'); |
|
232 | 232 | break; |
233 | 233 | case 'all_delete': |
234 | - $msg = __( 'Sites deleted.' ); |
|
234 | + $msg = __('Sites deleted.'); |
|
235 | 235 | break; |
236 | 236 | case 'delete': |
237 | - $msg = __( 'Site deleted.' ); |
|
237 | + $msg = __('Site deleted.'); |
|
238 | 238 | break; |
239 | 239 | case 'not_deleted': |
240 | - $msg = __( 'You do not have permission to delete that site.' ); |
|
240 | + $msg = __('You do not have permission to delete that site.'); |
|
241 | 241 | break; |
242 | 242 | case 'archiveblog': |
243 | - $msg = __( 'Site archived.' ); |
|
243 | + $msg = __('Site archived.'); |
|
244 | 244 | break; |
245 | 245 | case 'unarchiveblog': |
246 | - $msg = __( 'Site unarchived.' ); |
|
246 | + $msg = __('Site unarchived.'); |
|
247 | 247 | break; |
248 | 248 | case 'activateblog': |
249 | - $msg = __( 'Site activated.' ); |
|
249 | + $msg = __('Site activated.'); |
|
250 | 250 | break; |
251 | 251 | case 'deactivateblog': |
252 | - $msg = __( 'Site deactivated.' ); |
|
252 | + $msg = __('Site deactivated.'); |
|
253 | 253 | break; |
254 | 254 | case 'unspamblog': |
255 | - $msg = __( 'Site removed from spam.' ); |
|
255 | + $msg = __('Site removed from spam.'); |
|
256 | 256 | break; |
257 | 257 | case 'spamblog': |
258 | - $msg = __( 'Site marked as spam.' ); |
|
258 | + $msg = __('Site marked as spam.'); |
|
259 | 259 | break; |
260 | 260 | default: |
261 | 261 | /** |
@@ -268,37 +268,37 @@ discard block |
||
268 | 268 | * |
269 | 269 | * @param string $msg The update message. Default 'Settings saved'. |
270 | 270 | */ |
271 | - $msg = apply_filters( 'network_sites_updated_message_' . $_GET['updated'], __( 'Settings saved.' ) ); |
|
271 | + $msg = apply_filters('network_sites_updated_message_'.$_GET['updated'], __('Settings saved.')); |
|
272 | 272 | break; |
273 | 273 | } |
274 | 274 | |
275 | - if ( ! empty( $msg ) ) |
|
276 | - $msg = '<div class="updated" id="message notice is-dismissible"><p>' . $msg . '</p></div>'; |
|
275 | + if ( ! empty($msg)) |
|
276 | + $msg = '<div class="updated" id="message notice is-dismissible"><p>'.$msg.'</p></div>'; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | $wp_list_table->prepare_items(); |
280 | 280 | |
281 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
281 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
282 | 282 | ?> |
283 | 283 | |
284 | 284 | <div class="wrap"> |
285 | -<h1><?php _e( 'Sites' ); ?> |
|
285 | +<h1><?php _e('Sites'); ?> |
|
286 | 286 | |
287 | -<?php if ( current_user_can( 'create_sites') ) : ?> |
|
288 | - <a href="<?php echo network_admin_url('site-new.php'); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'site' ); ?></a> |
|
287 | +<?php if (current_user_can('create_sites')) : ?> |
|
288 | + <a href="<?php echo network_admin_url('site-new.php'); ?>" class="page-title-action"><?php echo esc_html_x('Add New', 'site'); ?></a> |
|
289 | 289 | <?php endif; ?> |
290 | 290 | |
291 | 291 | <?php |
292 | -if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { |
|
292 | +if (isset($_REQUEST['s']) && strlen($_REQUEST['s'])) { |
|
293 | 293 | /* translators: %s: search keywords */ |
294 | - printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) ); |
|
294 | + printf('<span class="subtitle">'.__('Search results for “%s”').'</span>', esc_html($s)); |
|
295 | 295 | } ?> |
296 | 296 | </h1> |
297 | 297 | |
298 | 298 | <?php echo $msg; ?> |
299 | 299 | |
300 | 300 | <form method="get" id="ms-search"> |
301 | -<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?> |
|
301 | +<?php $wp_list_table->search_box(__('Search Sites'), 'site'); ?> |
|
302 | 302 | <input type="hidden" name="action" value="blogs" /> |
303 | 303 | </form> |
304 | 304 | |
@@ -308,4 +308,4 @@ discard block |
||
308 | 308 | </div> |
309 | 309 | <?php |
310 | 310 | |
311 | -require_once( ABSPATH . 'wp-admin/admin-footer.php' ); ?> |
|
311 | +require_once(ABSPATH.'wp-admin/admin-footer.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/user-edit.php' ); |
|
16 | +require(ABSPATH.'wp-admin/user-edit.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/about.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/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/about.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 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Edit Site Users Administration Screen |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Multisite |
|
7 | - * @since 3.1.0 |
|
8 | - */ |
|
3 | + * Edit Site Users Administration Screen |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Multisite |
|
7 | + * @since 3.1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
87 | 87 | $update = 'newuser'; |
88 | 88 | /** |
89 | - * Fires after a user has been created via the network site-users.php page. |
|
90 | - * |
|
91 | - * @since 4.4.0 |
|
92 | - * |
|
93 | - * @param int $user_id ID of the newly created user. |
|
94 | - */ |
|
89 | + * Fires after a user has been created via the network site-users.php page. |
|
90 | + * |
|
91 | + * @since 4.4.0 |
|
92 | + * |
|
93 | + * @param int $user_id ID of the newly created user. |
|
94 | + */ |
|
95 | 95 | do_action( 'network_site_users_created_user', $user_id ); |
96 | 96 | } |
97 | 97 | } |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | |
271 | 271 | <?php |
272 | 272 | /** |
273 | - * Fires after the list table on the Users screen in the Multisite Network Admin. |
|
274 | - * |
|
275 | - * @since 3.1.0 |
|
276 | - */ |
|
273 | + * Fires after the list table on the Users screen in the Multisite Network Admin. |
|
274 | + * |
|
275 | + * @since 3.1.0 |
|
276 | + */ |
|
277 | 277 | do_action( 'network_site_users_after_list_table' ); |
278 | 278 | |
279 | 279 | /** This filter is documented in wp-admin/network/site-users.php */ |
@@ -8,82 +8,82 @@ 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 site URL is 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 site URL is 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 | -get_current_screen()->set_screen_reader_content( array( |
|
40 | - 'heading_views' => __( 'Filter site users list' ), |
|
41 | - 'heading_pagination' => __( 'Site users list navigation' ), |
|
42 | - 'heading_list' => __( 'Site users list' ), |
|
43 | -) ); |
|
39 | +get_current_screen()->set_screen_reader_content(array( |
|
40 | + 'heading_views' => __('Filter site users list'), |
|
41 | + 'heading_pagination' => __('Site users list navigation'), |
|
42 | + 'heading_list' => __('Site users list'), |
|
43 | +)); |
|
44 | 44 | |
45 | -$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] ); |
|
46 | -$referer = remove_query_arg( 'update', wp_get_referer() ); |
|
45 | +$_SERVER['REQUEST_URI'] = remove_query_arg('update', $_SERVER['REQUEST_URI']); |
|
46 | +$referer = remove_query_arg('update', wp_get_referer()); |
|
47 | 47 | |
48 | -if ( ! empty( $_REQUEST['paged'] ) ) { |
|
49 | - $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer ); |
|
48 | +if ( ! empty($_REQUEST['paged'])) { |
|
49 | + $referer = add_query_arg('paged', (int) $_REQUEST['paged'], $referer); |
|
50 | 50 | } |
51 | 51 | |
52 | -$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
|
52 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
53 | 53 | |
54 | -if ( ! $id ) |
|
55 | - wp_die( __('Invalid site ID.') ); |
|
54 | +if ( ! $id) |
|
55 | + wp_die(__('Invalid site ID.')); |
|
56 | 56 | |
57 | -$details = get_blog_details( $id ); |
|
58 | -if ( ! $details ) { |
|
59 | - wp_die( __( 'The requested site does not exist.' ) ); |
|
57 | +$details = get_blog_details($id); |
|
58 | +if ( ! $details) { |
|
59 | + wp_die(__('The requested site does not exist.')); |
|
60 | 60 | } |
61 | 61 | |
62 | -if ( ! can_edit_network( $details->site_id ) ) |
|
63 | - wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
|
62 | +if ( ! can_edit_network($details->site_id)) |
|
63 | + wp_die(__('You do not have permission to access this page.'), 403); |
|
64 | 64 | |
65 | -$is_main_site = is_main_site( $id ); |
|
65 | +$is_main_site = is_main_site($id); |
|
66 | 66 | |
67 | -switch_to_blog( $id ); |
|
67 | +switch_to_blog($id); |
|
68 | 68 | |
69 | 69 | $action = $wp_list_table->current_action(); |
70 | 70 | |
71 | -if ( $action ) { |
|
71 | +if ($action) { |
|
72 | 72 | |
73 | - switch ( $action ) { |
|
73 | + switch ($action) { |
|
74 | 74 | case 'newuser': |
75 | - check_admin_referer( 'add-user', '_wpnonce_add-new-user' ); |
|
75 | + check_admin_referer('add-user', '_wpnonce_add-new-user'); |
|
76 | 76 | $user = $_POST['user']; |
77 | - if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) { |
|
77 | + if ( ! is_array($_POST['user']) || empty($user['username']) || empty($user['email'])) { |
|
78 | 78 | $update = 'err_new'; |
79 | 79 | } else { |
80 | - $password = wp_generate_password( 12, false); |
|
81 | - $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); |
|
80 | + $password = wp_generate_password(12, false); |
|
81 | + $user_id = wpmu_create_user(esc_html(strtolower($user['username'])), $password, esc_html($user['email'])); |
|
82 | 82 | |
83 | - if ( false === $user_id ) { |
|
83 | + if (false === $user_id) { |
|
84 | 84 | $update = 'err_new_dup'; |
85 | 85 | } else { |
86 | - add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
|
86 | + add_user_to_blog($id, $user_id, $_POST['new_role']); |
|
87 | 87 | $update = 'newuser'; |
88 | 88 | /** |
89 | 89 | * Fires after a user has been created via the network site-users.php page. |
@@ -92,20 +92,20 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @param int $user_id ID of the newly created user. |
94 | 94 | */ |
95 | - do_action( 'network_site_users_created_user', $user_id ); |
|
95 | + do_action('network_site_users_created_user', $user_id); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | break; |
99 | 99 | |
100 | 100 | case 'adduser': |
101 | - check_admin_referer( 'add-user', '_wpnonce_add-user' ); |
|
102 | - if ( !empty( $_POST['newuser'] ) ) { |
|
101 | + check_admin_referer('add-user', '_wpnonce_add-user'); |
|
102 | + if ( ! empty($_POST['newuser'])) { |
|
103 | 103 | $update = 'adduser'; |
104 | 104 | $newuser = $_POST['newuser']; |
105 | - $user = get_user_by( 'login', $newuser ); |
|
106 | - if ( $user && $user->exists() ) { |
|
107 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
108 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
105 | + $user = get_user_by('login', $newuser); |
|
106 | + if ($user && $user->exists()) { |
|
107 | + if ( ! is_user_member_of_blog($user->ID, $id)) |
|
108 | + add_user_to_blog($id, $user->ID, $_POST['new_role']); |
|
109 | 109 | else |
110 | 110 | $update = 'err_add_member'; |
111 | 111 | } else { |
@@ -117,48 +117,48 @@ discard block |
||
117 | 117 | break; |
118 | 118 | |
119 | 119 | case 'remove': |
120 | - if ( ! current_user_can( 'remove_users' ) ) |
|
120 | + if ( ! current_user_can('remove_users')) |
|
121 | 121 | die(__('You can’t remove users.')); |
122 | - check_admin_referer( 'bulk-users' ); |
|
122 | + check_admin_referer('bulk-users'); |
|
123 | 123 | |
124 | 124 | $update = 'remove'; |
125 | - if ( isset( $_REQUEST['users'] ) ) { |
|
125 | + if (isset($_REQUEST['users'])) { |
|
126 | 126 | $userids = $_REQUEST['users']; |
127 | 127 | |
128 | - foreach ( $userids as $user_id ) { |
|
128 | + foreach ($userids as $user_id) { |
|
129 | 129 | $user_id = (int) $user_id; |
130 | - remove_user_from_blog( $user_id, $id ); |
|
130 | + remove_user_from_blog($user_id, $id); |
|
131 | 131 | } |
132 | - } elseif ( isset( $_GET['user'] ) ) { |
|
133 | - remove_user_from_blog( $_GET['user'] ); |
|
132 | + } elseif (isset($_GET['user'])) { |
|
133 | + remove_user_from_blog($_GET['user']); |
|
134 | 134 | } else { |
135 | 135 | $update = 'err_remove'; |
136 | 136 | } |
137 | 137 | break; |
138 | 138 | |
139 | 139 | case 'promote': |
140 | - check_admin_referer( 'bulk-users' ); |
|
140 | + check_admin_referer('bulk-users'); |
|
141 | 141 | $editable_roles = get_editable_roles(); |
142 | - if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) |
|
142 | + if (empty($editable_roles[$_REQUEST['new_role']])) |
|
143 | 143 | wp_die(__('You can’t give users that role.')); |
144 | 144 | |
145 | - if ( isset( $_REQUEST['users'] ) ) { |
|
145 | + if (isset($_REQUEST['users'])) { |
|
146 | 146 | $userids = $_REQUEST['users']; |
147 | 147 | $update = 'promote'; |
148 | - foreach ( $userids as $user_id ) { |
|
148 | + foreach ($userids as $user_id) { |
|
149 | 149 | $user_id = (int) $user_id; |
150 | 150 | |
151 | 151 | // If the user doesn't already belong to the blog, bail. |
152 | - if ( ! is_user_member_of_blog( $user_id ) ) { |
|
152 | + if ( ! is_user_member_of_blog($user_id)) { |
|
153 | 153 | wp_die( |
154 | - '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . |
|
155 | - '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>', |
|
154 | + '<h1>'.__('Cheatin’ uh?').'</h1>'. |
|
155 | + '<p>'.__('One of the selected users is not a member of this site.').'</p>', |
|
156 | 156 | 403 |
157 | 157 | ); |
158 | 158 | } |
159 | 159 | |
160 | - $user = get_userdata( $user_id ); |
|
161 | - $user->set_role( $_REQUEST['new_role'] ); |
|
160 | + $user = get_userdata($user_id); |
|
161 | + $user->set_role($_REQUEST['new_role']); |
|
162 | 162 | } |
163 | 163 | } else { |
164 | 164 | $update = 'err_promote'; |
@@ -166,20 +166,20 @@ discard block |
||
166 | 166 | break; |
167 | 167 | } |
168 | 168 | |
169 | - wp_safe_redirect( add_query_arg( 'update', $update, $referer ) ); |
|
169 | + wp_safe_redirect(add_query_arg('update', $update, $referer)); |
|
170 | 170 | exit(); |
171 | 171 | } |
172 | 172 | |
173 | 173 | restore_current_blog(); |
174 | 174 | |
175 | -if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { |
|
176 | - wp_safe_redirect( $referer ); |
|
175 | +if (isset($_GET['action']) && 'update-site' == $_GET['action']) { |
|
176 | + wp_safe_redirect($referer); |
|
177 | 177 | exit(); |
178 | 178 | } |
179 | 179 | |
180 | -add_screen_option( 'per_page' ); |
|
180 | +add_screen_option('per_page'); |
|
181 | 181 | |
182 | -$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
|
182 | +$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname)); |
|
183 | 183 | |
184 | 184 | $parent_file = 'sites.php'; |
185 | 185 | $submenu_file = 'sites.php'; |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
193 | 193 | */ |
194 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
195 | - wp_enqueue_script( 'user-suggest' ); |
|
194 | +if ( ! wp_is_large_network('users') && apply_filters('show_network_site_users_add_existing_form', true)) |
|
195 | + wp_enqueue_script('user-suggest'); |
|
196 | 196 | |
197 | -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
|
197 | +require(ABSPATH.'wp-admin/admin-header.php'); ?> |
|
198 | 198 | |
199 | 199 | <script type="text/javascript"> |
200 | 200 | var current_site_id = <?php echo $id; ?>; |
@@ -203,66 +203,66 @@ discard block |
||
203 | 203 | |
204 | 204 | <div class="wrap"> |
205 | 205 | <h1 id="edit-site"><?php echo $title; ?></h1> |
206 | -<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> |
|
206 | +<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> |
|
207 | 207 | <h2 class="nav-tab-wrapper nav-tab-small wp-clearfix"> |
208 | 208 | <?php |
209 | 209 | $tabs = array( |
210 | - 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ), |
|
211 | - 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ), |
|
212 | - 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ), |
|
213 | - 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ), |
|
210 | + 'site-info' => array('label' => __('Info'), 'url' => 'site-info.php'), |
|
211 | + 'site-users' => array('label' => __('Users'), 'url' => 'site-users.php'), |
|
212 | + 'site-themes' => array('label' => __('Themes'), 'url' => 'site-themes.php'), |
|
213 | + 'site-settings' => array('label' => __('Settings'), 'url' => 'site-settings.php'), |
|
214 | 214 | ); |
215 | -foreach ( $tabs as $tab_id => $tab ) { |
|
216 | - $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : ''; |
|
217 | - echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>'; |
|
215 | +foreach ($tabs as $tab_id => $tab) { |
|
216 | + $class = ($tab['url'] == $pagenow) ? ' nav-tab-active' : ''; |
|
217 | + echo '<a href="'.$tab['url'].'?id='.$id.'" class="nav-tab'.$class.'">'.esc_html($tab['label']).'</a>'; |
|
218 | 218 | } |
219 | 219 | ?> |
220 | 220 | </h2><?php |
221 | 221 | |
222 | -if ( isset($_GET['update']) ) : |
|
223 | - switch($_GET['update']) { |
|
222 | +if (isset($_GET['update'])) : |
|
223 | + switch ($_GET['update']) { |
|
224 | 224 | case 'adduser': |
225 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
225 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User added.').'</p></div>'; |
|
226 | 226 | break; |
227 | 227 | case 'err_add_member': |
228 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
228 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('User is already a member of this site.').'</p></div>'; |
|
229 | 229 | break; |
230 | 230 | case 'err_add_notfound': |
231 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
231 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username of an existing user.').'</p></div>'; |
|
232 | 232 | break; |
233 | 233 | case 'promote': |
234 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
234 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('Changed roles.').'</p></div>'; |
|
235 | 235 | break; |
236 | 236 | case 'err_promote': |
237 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
237 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to change role.').'</p></div>'; |
|
238 | 238 | break; |
239 | 239 | case 'remove': |
240 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
240 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User removed from this site.').'</p></div>'; |
|
241 | 241 | break; |
242 | 242 | case 'err_remove': |
243 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
243 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to remove.').'</p></div>'; |
|
244 | 244 | break; |
245 | 245 | case 'newuser': |
246 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
246 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User created.').'</p></div>'; |
|
247 | 247 | break; |
248 | 248 | case 'err_new': |
249 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
249 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username and email.').'</p></div>'; |
|
250 | 250 | break; |
251 | 251 | case 'err_new_dup': |
252 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
252 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Duplicated username or email address.').'</p></div>'; |
|
253 | 253 | break; |
254 | 254 | } |
255 | 255 | endif; ?> |
256 | 256 | |
257 | 257 | <form class="search-form" method="get"> |
258 | -<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> |
|
259 | -<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
258 | +<?php $wp_list_table->search_box(__('Search Users'), 'user'); ?> |
|
259 | +<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
260 | 260 | </form> |
261 | 261 | |
262 | 262 | <?php $wp_list_table->views(); ?> |
263 | 263 | |
264 | 264 | <form method="post" action="site-users.php?action=update-site"> |
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 | |
267 | 267 | <?php $wp_list_table->display(); ?> |
268 | 268 | |
@@ -274,27 +274,27 @@ discard block |
||
274 | 274 | * |
275 | 275 | * @since 3.1.0 |
276 | 276 | */ |
277 | -do_action( 'network_site_users_after_list_table' ); |
|
277 | +do_action('network_site_users_after_list_table'); |
|
278 | 278 | |
279 | 279 | /** This filter is documented in wp-admin/network/site-users.php */ |
280 | -if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?> |
|
281 | -<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2> |
|
280 | +if (current_user_can('promote_users') && apply_filters('show_network_site_users_add_existing_form', true)) : ?> |
|
281 | +<h2 id="add-existing-user"><?php _e('Add Existing User'); ?></h2> |
|
282 | 282 | <form action="site-users.php?action=adduser" id="adduser" method="post"> |
283 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
283 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
284 | 284 | <table class="form-table"> |
285 | 285 | <tr> |
286 | - <th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th> |
|
286 | + <th scope="row"><label for="newuser"><?php _e('Username'); ?></label></th> |
|
287 | 287 | <td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td> |
288 | 288 | </tr> |
289 | 289 | <tr> |
290 | - <th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th> |
|
290 | + <th scope="row"><label for="new_role_adduser"><?php _e('Role'); ?></label></th> |
|
291 | 291 | <td><select name="new_role" id="new_role_adduser"> |
292 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
292 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
293 | 293 | </select></td> |
294 | 294 | </tr> |
295 | 295 | </table> |
296 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?> |
|
297 | - <?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?> |
|
296 | + <?php wp_nonce_field('add-user', '_wpnonce_add-user') ?> |
|
297 | + <?php submit_button(__('Add User'), 'primary', 'add-user', true, array('id' => 'submit-add-existing-user')); ?> |
|
298 | 298 | </form> |
299 | 299 | <?php endif; ?> |
300 | 300 | |
@@ -306,33 +306,33 @@ discard block |
||
306 | 306 | * |
307 | 307 | * @param bool $bool Whether to show the Add New User form. Default true. |
308 | 308 | */ |
309 | -if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?> |
|
310 | -<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2> |
|
309 | +if (current_user_can('create_users') && apply_filters('show_network_site_users_add_new_form', true)) : ?> |
|
310 | +<h2 id="add-new-user"><?php _e('Add New User'); ?></h2> |
|
311 | 311 | <form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post"> |
312 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
312 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
313 | 313 | <table class="form-table"> |
314 | 314 | <tr> |
315 | - <th scope="row"><label for="user_username"><?php _e( 'Username' ) ?></label></th> |
|
315 | + <th scope="row"><label for="user_username"><?php _e('Username') ?></label></th> |
|
316 | 316 | <td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td> |
317 | 317 | </tr> |
318 | 318 | <tr> |
319 | - <th scope="row"><label for="user_email"><?php _e( 'Email' ) ?></label></th> |
|
319 | + <th scope="row"><label for="user_email"><?php _e('Email') ?></label></th> |
|
320 | 320 | <td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td> |
321 | 321 | </tr> |
322 | 322 | <tr> |
323 | - <th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th> |
|
323 | + <th scope="row"><label for="new_role_newuser"><?php _e('Role'); ?></label></th> |
|
324 | 324 | <td><select name="new_role" id="new_role_newuser"> |
325 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
325 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
326 | 326 | </select></td> |
327 | 327 | </tr> |
328 | 328 | <tr class="form-field"> |
329 | - <td colspan="2"><?php _e( 'A password reset link will be sent to the user via email.' ) ?></td> |
|
329 | + <td colspan="2"><?php _e('A password reset link will be sent to the user via email.') ?></td> |
|
330 | 330 | </tr> |
331 | 331 | </table> |
332 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?> |
|
333 | - <?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?> |
|
332 | + <?php wp_nonce_field('add-user', '_wpnonce_add-new-user') ?> |
|
333 | + <?php submit_button(__('Add New User'), 'primary', 'add-user', true, array('id' => 'submit-add-user')); ?> |
|
334 | 334 | </form> |
335 | 335 | <?php endif; ?> |
336 | 336 | </div> |
337 | 337 | <?php |
338 | -require( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
338 | +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(); |
@@ -51,16 +53,18 @@ discard block |
||
51 | 53 | |
52 | 54 | $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
53 | 55 | |
54 | -if ( ! $id ) |
|
56 | +if ( ! $id ) { |
|
55 | 57 | wp_die( __('Invalid site ID.') ); |
58 | +} |
|
56 | 59 | |
57 | 60 | $details = get_blog_details( $id ); |
58 | 61 | if ( ! $details ) { |
59 | 62 | wp_die( __( 'The requested site does not exist.' ) ); |
60 | 63 | } |
61 | 64 | |
62 | -if ( ! can_edit_network( $details->site_id ) ) |
|
65 | +if ( ! can_edit_network( $details->site_id ) ) { |
|
63 | 66 | wp_die( __( 'You do not have permission to access this page.' ), 403 ); |
67 | +} |
|
64 | 68 | |
65 | 69 | $is_main_site = is_main_site( $id ); |
66 | 70 | |
@@ -104,10 +108,11 @@ discard block |
||
104 | 108 | $newuser = $_POST['newuser']; |
105 | 109 | $user = get_user_by( 'login', $newuser ); |
106 | 110 | if ( $user && $user->exists() ) { |
107 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
108 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
109 | - else |
|
110 | - $update = 'err_add_member'; |
|
111 | + if ( ! is_user_member_of_blog( $user->ID, $id ) ) { |
|
112 | + add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
113 | + } else { |
|
114 | + $update = 'err_add_member'; |
|
115 | + } |
|
111 | 116 | } else { |
112 | 117 | $update = 'err_add_notfound'; |
113 | 118 | } |
@@ -117,8 +122,9 @@ discard block |
||
117 | 122 | break; |
118 | 123 | |
119 | 124 | case 'remove': |
120 | - if ( ! current_user_can( 'remove_users' ) ) |
|
121 | - die(__('You can’t remove users.')); |
|
125 | + if ( ! current_user_can( 'remove_users' ) ) { |
|
126 | + die(__('You can’t remove users.')); |
|
127 | + } |
|
122 | 128 | check_admin_referer( 'bulk-users' ); |
123 | 129 | |
124 | 130 | $update = 'remove'; |
@@ -139,8 +145,9 @@ discard block |
||
139 | 145 | case 'promote': |
140 | 146 | check_admin_referer( 'bulk-users' ); |
141 | 147 | $editable_roles = get_editable_roles(); |
142 | - if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) |
|
143 | - wp_die(__('You can’t give users that role.')); |
|
148 | + if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) { |
|
149 | + wp_die(__('You can’t give users that role.')); |
|
150 | + } |
|
144 | 151 | |
145 | 152 | if ( isset( $_REQUEST['users'] ) ) { |
146 | 153 | $userids = $_REQUEST['users']; |
@@ -191,8 +198,9 @@ discard block |
||
191 | 198 | * |
192 | 199 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
193 | 200 | */ |
194 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
201 | +if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) { |
|
195 | 202 | wp_enqueue_script( 'user-suggest' ); |
203 | +} |
|
196 | 204 | |
197 | 205 | require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
198 | 206 |