@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | require(dirname(__FILE__) . '/wp-load.php'); |
12 | 12 | |
13 | 13 | /** This filter is documented in wp-admin/options.php */ |
14 | -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) |
|
14 | +if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
15 | 15 | wp_die( __( 'This action has been disabled by the administrator.' ) ); |
16 | +} |
|
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Fires to allow a plugin to do a complete takeover of Post by Email. |
@@ -25,13 +26,16 @@ discard block |
||
25 | 26 | require_once( ABSPATH . WPINC . '/class-pop3.php' ); |
26 | 27 | |
27 | 28 | /** Only check at this interval for new messages. */ |
28 | -if ( !defined('WP_MAIL_INTERVAL') ) |
|
29 | - define('WP_MAIL_INTERVAL', 300); // 5 minutes |
|
29 | +if ( !defined('WP_MAIL_INTERVAL') ) { |
|
30 | + define('WP_MAIL_INTERVAL', 300); |
|
31 | +} |
|
32 | +// 5 minutes |
|
30 | 33 | |
31 | 34 | $last_checked = get_transient('mailserver_last_checked'); |
32 | 35 | |
33 | -if ( $last_checked ) |
|
36 | +if ( $last_checked ) { |
|
34 | 37 | wp_die(__('Slow down cowboy, no need to check for new mails so often!')); |
38 | +} |
|
35 | 39 | |
36 | 40 | set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); |
37 | 41 | |
@@ -41,13 +45,15 @@ discard block |
||
41 | 45 | |
42 | 46 | $pop3 = new POP3(); |
43 | 47 | |
44 | -if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) |
|
48 | +if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) { |
|
45 | 49 | wp_die( esc_html( $pop3->ERROR ) ); |
50 | +} |
|
46 | 51 | |
47 | 52 | $count = $pop3->pass( get_option('mailserver_pass') ); |
48 | 53 | |
49 | -if( false === $count ) |
|
54 | +if( false === $count ) { |
|
50 | 55 | wp_die( esc_html( $pop3->ERROR ) ); |
56 | +} |
|
51 | 57 | |
52 | 58 | if( 0 === $count ) { |
53 | 59 | $pop3->quit(); |
@@ -69,8 +75,9 @@ discard block |
||
69 | 75 | $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); |
70 | 76 | foreach ($message as $line) { |
71 | 77 | // Body signal. |
72 | - if ( strlen($line) < 3 ) |
|
73 | - $bodysignal = true; |
|
78 | + if ( strlen($line) < 3 ) { |
|
79 | + $bodysignal = true; |
|
80 | + } |
|
74 | 81 | if ( $bodysignal ) { |
75 | 82 | $content .= $line; |
76 | 83 | } else { |
@@ -113,10 +120,11 @@ discard block |
||
113 | 120 | * otherwise use the site admin. |
114 | 121 | */ |
115 | 122 | if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { |
116 | - if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) |
|
117 | - $author = $matches[0]; |
|
118 | - else |
|
119 | - $author = trim($line); |
|
123 | + if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) { |
|
124 | + $author = $matches[0]; |
|
125 | + } else { |
|
126 | + $author = trim($line); |
|
127 | + } |
|
120 | 128 | $author = sanitize_email($author); |
121 | 129 | if ( is_email($author) ) { |
122 | 130 | echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; |
@@ -220,7 +228,9 @@ discard block |
||
220 | 228 | |
221 | 229 | $post_title = xmlrpc_getposttitle($content); |
222 | 230 | |
223 | - if ($post_title == '') $post_title = $subject; |
|
231 | + if ($post_title == '') { |
|
232 | + $post_title = $subject; |
|
233 | + } |
|
224 | 234 | |
225 | 235 | $post_category = array(get_option('default_email_category')); |
226 | 236 | |
@@ -228,12 +238,14 @@ discard block |
||
228 | 238 | $post_data = wp_slash($post_data); |
229 | 239 | |
230 | 240 | $post_ID = wp_insert_post($post_data); |
231 | - if ( is_wp_error( $post_ID ) ) |
|
232 | - echo "\n" . $post_ID->get_error_message(); |
|
241 | + if ( is_wp_error( $post_ID ) ) { |
|
242 | + echo "\n" . $post_ID->get_error_message(); |
|
243 | + } |
|
233 | 244 | |
234 | 245 | // We couldn't post, for whatever reason. Better move forward to the next email. |
235 | - if ( empty( $post_ID ) ) |
|
236 | - continue; |
|
246 | + if ( empty( $post_ID ) ) { |
|
247 | + continue; |
|
248 | + } |
|
237 | 249 | |
238 | 250 | /** |
239 | 251 | * Fires after a post submitted by email is published. |
@@ -8,29 +8,29 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Make sure that the WordPress bootstrap has run before continuing. */ |
11 | -require(dirname(__FILE__) . '/wp-load.php'); |
|
11 | +require(dirname(__FILE__).'/wp-load.php'); |
|
12 | 12 | |
13 | 13 | /** This filter is documented in wp-admin/options.php */ |
14 | -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) |
|
15 | - wp_die( __( 'This action has been disabled by the administrator.' ) ); |
|
14 | +if ( ! apply_filters('enable_post_by_email_configuration', true)) |
|
15 | + wp_die(__('This action has been disabled by the administrator.')); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Fires to allow a plugin to do a complete takeover of Post by Email. |
19 | 19 | * |
20 | 20 | * @since 2.9.0 |
21 | 21 | */ |
22 | -do_action( 'wp-mail.php' ); |
|
22 | +do_action('wp-mail.php'); |
|
23 | 23 | |
24 | 24 | /** Get the POP3 class with which to access the mailbox. */ |
25 | -require_once( ABSPATH . WPINC . '/class-pop3.php' ); |
|
25 | +require_once(ABSPATH.WPINC.'/class-pop3.php'); |
|
26 | 26 | |
27 | 27 | /** Only check at this interval for new messages. */ |
28 | -if ( !defined('WP_MAIL_INTERVAL') ) |
|
28 | +if ( ! defined('WP_MAIL_INTERVAL')) |
|
29 | 29 | define('WP_MAIL_INTERVAL', 300); // 5 minutes |
30 | 30 | |
31 | 31 | $last_checked = get_transient('mailserver_last_checked'); |
32 | 32 | |
33 | -if ( $last_checked ) |
|
33 | +if ($last_checked) |
|
34 | 34 | wp_die(__('Slow down cowboy, no need to check for new mails so often!')); |
35 | 35 | |
36 | 36 | set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | |
42 | 42 | $pop3 = new POP3(); |
43 | 43 | |
44 | -if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) |
|
45 | - wp_die( esc_html( $pop3->ERROR ) ); |
|
44 | +if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port')) || ! $pop3->user(get_option('mailserver_login'))) |
|
45 | + wp_die(esc_html($pop3->ERROR)); |
|
46 | 46 | |
47 | -$count = $pop3->pass( get_option('mailserver_pass') ); |
|
47 | +$count = $pop3->pass(get_option('mailserver_pass')); |
|
48 | 48 | |
49 | -if( false === $count ) |
|
50 | - wp_die( esc_html( $pop3->ERROR ) ); |
|
49 | +if (false === $count) |
|
50 | + wp_die(esc_html($pop3->ERROR)); |
|
51 | 51 | |
52 | -if( 0 === $count ) { |
|
52 | +if (0 === $count) { |
|
53 | 53 | $pop3->quit(); |
54 | - wp_die( __('There doesn’t seem to be any new mail.') ); |
|
54 | + wp_die(__('There doesn’t seem to be any new mail.')); |
|
55 | 55 | } |
56 | 56 | |
57 | -for ( $i = 1; $i <= $count; $i++ ) { |
|
57 | +for ($i = 1; $i <= $count; $i++) { |
|
58 | 58 | |
59 | 59 | $message = $pop3->get($i); |
60 | 60 | |
@@ -69,28 +69,28 @@ discard block |
||
69 | 69 | $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); |
70 | 70 | foreach ($message as $line) { |
71 | 71 | // Body signal. |
72 | - if ( strlen($line) < 3 ) |
|
72 | + if (strlen($line) < 3) |
|
73 | 73 | $bodysignal = true; |
74 | - if ( $bodysignal ) { |
|
74 | + if ($bodysignal) { |
|
75 | 75 | $content .= $line; |
76 | 76 | } else { |
77 | - if ( preg_match('/Content-Type: /i', $line) ) { |
|
77 | + if (preg_match('/Content-Type: /i', $line)) { |
|
78 | 78 | $content_type = trim($line); |
79 | 79 | $content_type = substr($content_type, 14, strlen($content_type) - 14); |
80 | 80 | $content_type = explode(';', $content_type); |
81 | - if ( ! empty( $content_type[1] ) ) { |
|
81 | + if ( ! empty($content_type[1])) { |
|
82 | 82 | $charset = explode('=', $content_type[1]); |
83 | - $charset = ( ! empty( $charset[1] ) ) ? trim($charset[1]) : ''; |
|
83 | + $charset = ( ! empty($charset[1])) ? trim($charset[1]) : ''; |
|
84 | 84 | } |
85 | 85 | $content_type = $content_type[0]; |
86 | 86 | } |
87 | - if ( preg_match('/Content-Transfer-Encoding: /i', $line) ) { |
|
87 | + if (preg_match('/Content-Transfer-Encoding: /i', $line)) { |
|
88 | 88 | $content_transfer_encoding = trim($line); |
89 | 89 | $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding) - 27); |
90 | 90 | $content_transfer_encoding = explode(';', $content_transfer_encoding); |
91 | 91 | $content_transfer_encoding = $content_transfer_encoding[0]; |
92 | 92 | } |
93 | - if ( ( $content_type == 'multipart/alternative' ) && ( false !== strpos($line, 'boundary="') ) && ( '' == $boundary ) ) { |
|
93 | + if (($content_type == 'multipart/alternative') && (false !== strpos($line, 'boundary="')) && ('' == $boundary)) { |
|
94 | 94 | $boundary = trim($line); |
95 | 95 | $boundary = explode('"', $boundary); |
96 | 96 | $boundary = $boundary[1]; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $subject = trim($line); |
100 | 100 | $subject = substr($subject, 9, strlen($subject) - 9); |
101 | 101 | // Captures any text in the subject before $phone_delim as the subject |
102 | - if ( function_exists('iconv_mime_decode') ) { |
|
102 | + if (function_exists('iconv_mime_decode')) { |
|
103 | 103 | $subject = iconv_mime_decode($subject, 2, get_option('blog_charset')); |
104 | 104 | } else { |
105 | 105 | $subject = wp_iso_descrambler($subject); |
@@ -112,36 +112,36 @@ discard block |
||
112 | 112 | * Set the author using the email address (From or Reply-To, the last used) |
113 | 113 | * otherwise use the site admin. |
114 | 114 | */ |
115 | - if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { |
|
116 | - if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) |
|
115 | + if ( ! $author_found && preg_match('/^(From|Reply-To): /', $line)) { |
|
116 | + if (preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches)) |
|
117 | 117 | $author = $matches[0]; |
118 | 118 | else |
119 | 119 | $author = trim($line); |
120 | 120 | $author = sanitize_email($author); |
121 | - if ( is_email($author) ) { |
|
122 | - echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; |
|
121 | + if (is_email($author)) { |
|
122 | + echo '<p>'.sprintf(__('Author is %s'), $author).'</p>'; |
|
123 | 123 | $userdata = get_user_by('email', $author); |
124 | - if ( ! empty( $userdata ) ) { |
|
124 | + if ( ! empty($userdata)) { |
|
125 | 125 | $post_author = $userdata->ID; |
126 | 126 | $author_found = true; |
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - if ( preg_match( '/Date: /i', $line ) ) { // of the form '20 Mar 2002 20:32:37 +0100' |
|
132 | - $ddate = str_replace( 'Date: ', '', trim( $line ) ); |
|
133 | - $ddate = preg_replace( '!\s*\(.+\)\s*$!', '', $ddate ); // remove parenthesised timezone string if it exists, as this confuses strtotime |
|
134 | - $ddate_U = strtotime( $ddate ); |
|
135 | - $post_date = gmdate( 'Y-m-d H:i:s', $ddate_U + $time_difference ); |
|
136 | - $post_date_gmt = gmdate( 'Y-m-d H:i:s', $ddate_U ); |
|
131 | + if (preg_match('/Date: /i', $line)) { // of the form '20 Mar 2002 20:32:37 +0100' |
|
132 | + $ddate = str_replace('Date: ', '', trim($line)); |
|
133 | + $ddate = preg_replace('!\s*\(.+\)\s*$!', '', $ddate); // remove parenthesised timezone string if it exists, as this confuses strtotime |
|
134 | + $ddate_U = strtotime($ddate); |
|
135 | + $post_date = gmdate('Y-m-d H:i:s', $ddate_U + $time_difference); |
|
136 | + $post_date_gmt = gmdate('Y-m-d H:i:s', $ddate_U); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Set $post_status based on $author_found and on author's publish_posts capability |
142 | - if ( $author_found ) { |
|
142 | + if ($author_found) { |
|
143 | 143 | $user = new WP_User($post_author); |
144 | - $post_status = ( $user->has_cap('publish_posts') ) ? 'publish' : 'pending'; |
|
144 | + $post_status = ($user->has_cap('publish_posts')) ? 'publish' : 'pending'; |
|
145 | 145 | } else { |
146 | 146 | // Author not found in DB, set status to pending. Author already set to admin. |
147 | 147 | $post_status = 'pending'; |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | |
150 | 150 | $subject = trim($subject); |
151 | 151 | |
152 | - if ( $content_type == 'multipart/alternative' ) { |
|
152 | + if ($content_type == 'multipart/alternative') { |
|
153 | 153 | $content = explode('--'.$boundary, $content); |
154 | 154 | $content = $content[2]; |
155 | 155 | |
156 | 156 | // Match case-insensitive content-transfer-encoding. |
157 | - if ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim) ) { |
|
157 | + if (preg_match('/Content-Transfer-Encoding: quoted-printable/i', $content, $delim)) { |
|
158 | 158 | $content = explode($delim[0], $content); |
159 | 159 | $content = $content[1]; |
160 | 160 | } |
@@ -172,19 +172,19 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @param string $content The original email content. |
174 | 174 | */ |
175 | - $content = apply_filters( 'wp_mail_original_content', $content ); |
|
175 | + $content = apply_filters('wp_mail_original_content', $content); |
|
176 | 176 | |
177 | - if ( false !== stripos($content_transfer_encoding, "quoted-printable") ) { |
|
177 | + if (false !== stripos($content_transfer_encoding, "quoted-printable")) { |
|
178 | 178 | $content = quoted_printable_decode($content); |
179 | 179 | } |
180 | 180 | |
181 | - if ( function_exists('iconv') && ! empty( $charset ) ) { |
|
181 | + if (function_exists('iconv') && ! empty($charset)) { |
|
182 | 182 | $content = iconv($charset, get_option('blog_charset'), $content); |
183 | 183 | } |
184 | 184 | |
185 | 185 | // Captures any text in the body after $phone_delim as the body |
186 | 186 | $content = explode($phone_delim, $content); |
187 | - $content = empty( $content[1] ) ? $content[0] : $content[1]; |
|
187 | + $content = empty($content[1]) ? $content[0] : $content[1]; |
|
188 | 188 | |
189 | 189 | $content = trim($content); |
190 | 190 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @param string $content The email content. |
197 | 197 | */ |
198 | - $post_content = apply_filters( 'phone_content', $content ); |
|
198 | + $post_content = apply_filters('phone_content', $content); |
|
199 | 199 | |
200 | 200 | $post_title = xmlrpc_getposttitle($content); |
201 | 201 | |
@@ -203,15 +203,15 @@ discard block |
||
203 | 203 | |
204 | 204 | $post_category = array(get_option('default_email_category')); |
205 | 205 | |
206 | - $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); |
|
206 | + $post_data = compact('post_content', 'post_title', 'post_date', 'post_date_gmt', 'post_author', 'post_category', 'post_status'); |
|
207 | 207 | $post_data = wp_slash($post_data); |
208 | 208 | |
209 | 209 | $post_ID = wp_insert_post($post_data); |
210 | - if ( is_wp_error( $post_ID ) ) |
|
211 | - echo "\n" . $post_ID->get_error_message(); |
|
210 | + if (is_wp_error($post_ID)) |
|
211 | + echo "\n".$post_ID->get_error_message(); |
|
212 | 212 | |
213 | 213 | // We couldn't post, for whatever reason. Better move forward to the next email. |
214 | - if ( empty( $post_ID ) ) |
|
214 | + if (empty($post_ID)) |
|
215 | 215 | continue; |
216 | 216 | |
217 | 217 | /** |
@@ -221,25 +221,25 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @param int $post_ID The post ID. |
223 | 223 | */ |
224 | - do_action( 'publish_phone', $post_ID ); |
|
224 | + do_action('publish_phone', $post_ID); |
|
225 | 225 | |
226 | - echo "\n<p><strong>" . __( 'Author:' ) . '</strong> ' . esc_html( $post_author ) . '</p>'; |
|
227 | - echo "\n<p><strong>" . __( 'Posted title:' ) . '</strong> ' . esc_html( $post_title ) . '</p>'; |
|
226 | + echo "\n<p><strong>".__('Author:').'</strong> '.esc_html($post_author).'</p>'; |
|
227 | + echo "\n<p><strong>".__('Posted title:').'</strong> '.esc_html($post_title).'</p>'; |
|
228 | 228 | |
229 | - if(!$pop3->delete($i)) { |
|
230 | - echo '<p>' . sprintf( |
|
229 | + if ( ! $pop3->delete($i)) { |
|
230 | + echo '<p>'.sprintf( |
|
231 | 231 | /* translators: %s: POP3 error */ |
232 | - __( 'Oops: %s' ), |
|
233 | - esc_html( $pop3->ERROR ) |
|
234 | - ) . '</p>'; |
|
232 | + __('Oops: %s'), |
|
233 | + esc_html($pop3->ERROR) |
|
234 | + ).'</p>'; |
|
235 | 235 | $pop3->reset(); |
236 | 236 | exit; |
237 | 237 | } else { |
238 | - echo '<p>' . sprintf( |
|
238 | + echo '<p>'.sprintf( |
|
239 | 239 | /* translators: %s: the message ID */ |
240 | - __( 'Mission complete. Message %s deleted.' ), |
|
241 | - '<strong>' . $i . '</strong>' |
|
242 | - ) . '</p>'; |
|
240 | + __('Mission complete. Message %s deleted.'), |
|
241 | + '<strong>'.$i.'</strong>' |
|
242 | + ).'</p>'; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | } |
@@ -12,21 +12,21 @@ discard block |
||
12 | 12 | * @package WordPress |
13 | 13 | */ |
14 | 14 | |
15 | -require_once( dirname( __FILE__ ) . '/wp-load.php' ); |
|
15 | +require_once(dirname(__FILE__).'/wp-load.php'); |
|
16 | 16 | |
17 | -header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); |
|
17 | +header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); |
|
18 | 18 | $link_cat = ''; |
19 | -if ( !empty($_GET['link_cat']) ) { |
|
19 | +if ( ! empty($_GET['link_cat'])) { |
|
20 | 20 | $link_cat = $_GET['link_cat']; |
21 | - if ( !in_array($link_cat, array('all', '0')) ) |
|
22 | - $link_cat = absint( (string)urldecode($link_cat) ); |
|
21 | + if ( ! in_array($link_cat, array('all', '0'))) |
|
22 | + $link_cat = absint((string) urldecode($link_cat)); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | echo '<?xml version="1.0"?'.">\n"; |
26 | 26 | ?> |
27 | 27 | <opml version="1.0"> |
28 | 28 | <head> |
29 | - <title><?php printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); ?></title> |
|
29 | + <title><?php printf(__('Links for %s'), esc_attr(get_bloginfo('name', 'display'))); ?></title> |
|
30 | 30 | <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated> |
31 | 31 | <?php |
32 | 32 | /** |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @since 3.0.0 |
36 | 36 | */ |
37 | - do_action( 'opml_head' ); |
|
37 | + do_action('opml_head'); |
|
38 | 38 | ?> |
39 | 39 | </head> |
40 | 40 | <body> |
41 | 41 | <?php |
42 | -if ( empty($link_cat) ) |
|
42 | +if (empty($link_cat)) |
|
43 | 43 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0)); |
44 | 44 | else |
45 | 45 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); |
46 | 46 | |
47 | -foreach ( (array)$cats as $cat ) : |
|
47 | +foreach ((array) $cats as $cat) : |
|
48 | 48 | /** |
49 | 49 | * Filter the OPML outline link category name. |
50 | 50 | * |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @param string $catname The OPML outline category name. |
54 | 54 | */ |
55 | - $catname = apply_filters( 'link_category', $cat->name ); |
|
55 | + $catname = apply_filters('link_category', $cat->name); |
|
56 | 56 | |
57 | 57 | ?> |
58 | 58 | <outline type="category" title="<?php echo esc_attr($catname); ?>"> |
59 | 59 | <?php |
60 | 60 | $bookmarks = get_bookmarks(array("category" => $cat->term_id)); |
61 | - foreach ( (array)$bookmarks as $bookmark ) : |
|
61 | + foreach ((array) $bookmarks as $bookmark) : |
|
62 | 62 | /** |
63 | 63 | * Filter the OPML outline link title text. |
64 | 64 | * |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param string $title The OPML outline title text. |
68 | 68 | */ |
69 | - $title = apply_filters( 'link_title', $bookmark->link_name ); |
|
69 | + $title = apply_filters('link_title', $bookmark->link_name); |
|
70 | 70 | ?> |
71 | 71 | <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" /> |
72 | 72 | <?php |
@@ -18,9 +18,10 @@ discard block |
||
18 | 18 | $link_cat = ''; |
19 | 19 | if ( !empty($_GET['link_cat']) ) { |
20 | 20 | $link_cat = $_GET['link_cat']; |
21 | - if ( !in_array($link_cat, array('all', '0')) ) |
|
22 | - $link_cat = absint( (string)urldecode($link_cat) ); |
|
23 | -} |
|
21 | + if ( !in_array($link_cat, array('all', '0')) ) { |
|
22 | + $link_cat = absint( (string)urldecode($link_cat) ); |
|
23 | + } |
|
24 | + } |
|
24 | 25 | |
25 | 26 | echo '<?xml version="1.0"?'.">\n"; |
26 | 27 | ?> |
@@ -39,10 +40,11 @@ discard block |
||
39 | 40 | </head> |
40 | 41 | <body> |
41 | 42 | <?php |
42 | -if ( empty($link_cat) ) |
|
43 | +if ( empty($link_cat) ) { |
|
43 | 44 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0)); |
44 | -else |
|
45 | +} else { |
|
45 | 46 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); |
47 | +} |
|
46 | 48 | |
47 | 49 | foreach ( (array)$cats as $cat ) : |
48 | 50 | /** |
@@ -68,7 +70,10 @@ discard block |
||
68 | 70 | */ |
69 | 71 | $title = apply_filters( 'link_title', $bookmark->link_name ); |
70 | 72 | ?> |
71 | - <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" /> |
|
73 | + <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) { |
|
74 | + echo $bookmark->link_updated; |
|
75 | +} |
|
76 | +?>" /> |
|
72 | 77 | <?php |
73 | 78 | endforeach; // $bookmarks |
74 | 79 | ?> |
@@ -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><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br /> |
|
86 | -<label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br /> |
|
87 | -<label><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><input type="radio"<?php checked($comment->comment_approved, '1'); ?> name="comment_status" value="1" /><?php _ex('Approved', 'comment status'); ?></label><br /> |
|
86 | +<label><input type="radio"<?php checked($comment->comment_approved, '0'); ?> name="comment_status" value="0" /><?php _ex('Pending', 'comment status'); ?></label><br /> |
|
87 | +<label><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 https://secure.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 | } |
@@ -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' ); |