@@ -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 | ?> |
@@ -12,14 +12,14 @@ 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"; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | <head> |
29 | 29 | <title><?php |
30 | 30 | /* translators: 1: Site name */ |
31 | - printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); |
|
31 | + printf(__('Links for %s'), esc_attr(get_bloginfo('name', 'display'))); |
|
32 | 32 | ?></title> |
33 | 33 | <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated> |
34 | 34 | <?php |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @since 3.0.0 |
39 | 39 | */ |
40 | - do_action( 'opml_head' ); |
|
40 | + do_action('opml_head'); |
|
41 | 41 | ?> |
42 | 42 | </head> |
43 | 43 | <body> |
44 | 44 | <?php |
45 | -if ( empty($link_cat) ) |
|
45 | +if (empty($link_cat)) |
|
46 | 46 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0)); |
47 | 47 | else |
48 | 48 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); |
49 | 49 | |
50 | -foreach ( (array)$cats as $cat ) : |
|
50 | +foreach ((array) $cats as $cat) : |
|
51 | 51 | /** |
52 | 52 | * Filters the OPML outline link category name. |
53 | 53 | * |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param string $catname The OPML outline category name. |
57 | 57 | */ |
58 | - $catname = apply_filters( 'link_category', $cat->name ); |
|
58 | + $catname = apply_filters('link_category', $cat->name); |
|
59 | 59 | |
60 | 60 | ?> |
61 | 61 | <outline type="category" title="<?php echo esc_attr($catname); ?>"> |
62 | 62 | <?php |
63 | 63 | $bookmarks = get_bookmarks(array("category" => $cat->term_id)); |
64 | - foreach ( (array)$bookmarks as $bookmark ) : |
|
64 | + foreach ((array) $bookmarks as $bookmark) : |
|
65 | 65 | /** |
66 | 66 | * Filters the OPML outline link title text. |
67 | 67 | * |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @param string $title The OPML outline title text. |
71 | 71 | */ |
72 | - $title = apply_filters( 'link_title', $bookmark->link_name ); |
|
72 | + $title = apply_filters('link_title', $bookmark->link_name); |
|
73 | 73 | ?> |
74 | 74 | <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; ?>" /> |
75 | 75 | <?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><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 large', 'save', false ); ?> |
|
165 | +<?php submit_button(__('Update'), 'primary large', '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> |
@@ -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( __( 'Sorry, you are not allowed to manage options for this site.' ) ); |
|
12 | +if ( ! current_user_can('manage_options')) |
|
13 | + wp_die(__('Sorry, you are not allowed 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">Documentation on Media Settings</a>') . '</p>' . |
|
35 | - '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
|
33 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
34 | + '<p>'.__('<a href="https://codex.wordpress.org/Settings_Media_Screen">Documentation on Media Settings</a>').'</p>'. |
|
35 | + '<p>'.__('<a href="https://wordpress.org/support/">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; |
@@ -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 |
@@ -86,12 +86,12 @@ |
||
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 | } |
@@ -8,79 +8,79 @@ 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 ( ! current_user_can('manage_sites') ) |
|
13 | +if ( ! current_user_can('manage_sites')) |
|
14 | 14 | wp_die(__('Sorry, you are not allowed to edit this site.')); |
15 | 15 | |
16 | 16 | $wp_list_table = _get_list_table('WP_Users_List_Table'); |
17 | 17 | $wp_list_table->prepare_items(); |
18 | 18 | |
19 | -get_current_screen()->add_help_tab( array( |
|
19 | +get_current_screen()->add_help_tab(array( |
|
20 | 20 | 'id' => 'overview', |
21 | 21 | 'title' => __('Overview'), |
22 | 22 | 'content' => |
23 | - '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' . |
|
24 | - '<p>' . __('<strong>Info</strong> — The 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>' . |
|
25 | - '<p>' . __('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' . |
|
26 | - '<p>' . sprintf( __('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' . |
|
27 | - '<p>' . __('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' |
|
28 | -) ); |
|
23 | + '<p>'.__('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.').'</p>'. |
|
24 | + '<p>'.__('<strong>Info</strong> — The 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>'. |
|
25 | + '<p>'.__('<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.').'</p>'. |
|
26 | + '<p>'.sprintf(__('<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.'), network_admin_url('themes.php')).'</p>'. |
|
27 | + '<p>'.__('<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.').'</p>' |
|
28 | +)); |
|
29 | 29 | |
30 | 30 | get_current_screen()->set_help_sidebar( |
31 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
32 | - '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' . |
|
33 | - '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>' |
|
31 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
32 | + '<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>').'</p>'. |
|
33 | + '<p>'.__('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>').'</p>' |
|
34 | 34 | ); |
35 | 35 | |
36 | -get_current_screen()->set_screen_reader_content( array( |
|
37 | - 'heading_views' => __( 'Filter site users list' ), |
|
38 | - 'heading_pagination' => __( 'Site users list navigation' ), |
|
39 | - 'heading_list' => __( 'Site users list' ), |
|
40 | -) ); |
|
36 | +get_current_screen()->set_screen_reader_content(array( |
|
37 | + 'heading_views' => __('Filter site users list'), |
|
38 | + 'heading_pagination' => __('Site users list navigation'), |
|
39 | + 'heading_list' => __('Site users list'), |
|
40 | +)); |
|
41 | 41 | |
42 | -$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] ); |
|
43 | -$referer = remove_query_arg( 'update', wp_get_referer() ); |
|
42 | +$_SERVER['REQUEST_URI'] = remove_query_arg('update', $_SERVER['REQUEST_URI']); |
|
43 | +$referer = remove_query_arg('update', wp_get_referer()); |
|
44 | 44 | |
45 | -if ( ! empty( $_REQUEST['paged'] ) ) { |
|
46 | - $referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer ); |
|
45 | +if ( ! empty($_REQUEST['paged'])) { |
|
46 | + $referer = add_query_arg('paged', (int) $_REQUEST['paged'], $referer); |
|
47 | 47 | } |
48 | 48 | |
49 | -$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
|
49 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
50 | 50 | |
51 | -if ( ! $id ) |
|
52 | - wp_die( __('Invalid site ID.') ); |
|
51 | +if ( ! $id) |
|
52 | + wp_die(__('Invalid site ID.')); |
|
53 | 53 | |
54 | -$details = get_site( $id ); |
|
55 | -if ( ! $details ) { |
|
56 | - wp_die( __( 'The requested site does not exist.' ) ); |
|
54 | +$details = get_site($id); |
|
55 | +if ( ! $details) { |
|
56 | + wp_die(__('The requested site does not exist.')); |
|
57 | 57 | } |
58 | 58 | |
59 | -if ( ! can_edit_network( $details->site_id ) ) |
|
60 | - wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); |
|
59 | +if ( ! can_edit_network($details->site_id)) |
|
60 | + wp_die(__('Sorry, you are not allowed to access this page.'), 403); |
|
61 | 61 | |
62 | -$is_main_site = is_main_site( $id ); |
|
62 | +$is_main_site = is_main_site($id); |
|
63 | 63 | |
64 | -switch_to_blog( $id ); |
|
64 | +switch_to_blog($id); |
|
65 | 65 | |
66 | 66 | $action = $wp_list_table->current_action(); |
67 | 67 | |
68 | -if ( $action ) { |
|
68 | +if ($action) { |
|
69 | 69 | |
70 | - switch ( $action ) { |
|
70 | + switch ($action) { |
|
71 | 71 | case 'newuser': |
72 | - check_admin_referer( 'add-user', '_wpnonce_add-new-user' ); |
|
72 | + check_admin_referer('add-user', '_wpnonce_add-new-user'); |
|
73 | 73 | $user = $_POST['user']; |
74 | - if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) { |
|
74 | + if ( ! is_array($_POST['user']) || empty($user['username']) || empty($user['email'])) { |
|
75 | 75 | $update = 'err_new'; |
76 | 76 | } else { |
77 | - $password = wp_generate_password( 12, false); |
|
78 | - $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); |
|
77 | + $password = wp_generate_password(12, false); |
|
78 | + $user_id = wpmu_create_user(esc_html(strtolower($user['username'])), $password, esc_html($user['email'])); |
|
79 | 79 | |
80 | - if ( false === $user_id ) { |
|
80 | + if (false === $user_id) { |
|
81 | 81 | $update = 'err_new_dup'; |
82 | 82 | } else { |
83 | - add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
|
83 | + add_user_to_blog($id, $user_id, $_POST['new_role']); |
|
84 | 84 | $update = 'newuser'; |
85 | 85 | /** |
86 | 86 | * Fires after a user has been created via the network site-users.php page. |
@@ -89,20 +89,20 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @param int $user_id ID of the newly created user. |
91 | 91 | */ |
92 | - do_action( 'network_site_users_created_user', $user_id ); |
|
92 | + do_action('network_site_users_created_user', $user_id); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | break; |
96 | 96 | |
97 | 97 | case 'adduser': |
98 | - check_admin_referer( 'add-user', '_wpnonce_add-user' ); |
|
99 | - if ( !empty( $_POST['newuser'] ) ) { |
|
98 | + check_admin_referer('add-user', '_wpnonce_add-user'); |
|
99 | + if ( ! empty($_POST['newuser'])) { |
|
100 | 100 | $update = 'adduser'; |
101 | 101 | $newuser = $_POST['newuser']; |
102 | - $user = get_user_by( 'login', $newuser ); |
|
103 | - if ( $user && $user->exists() ) { |
|
104 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
105 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
102 | + $user = get_user_by('login', $newuser); |
|
103 | + if ($user && $user->exists()) { |
|
104 | + if ( ! is_user_member_of_blog($user->ID, $id)) |
|
105 | + add_user_to_blog($id, $user->ID, $_POST['new_role']); |
|
106 | 106 | else |
107 | 107 | $update = 'err_add_member'; |
108 | 108 | } else { |
@@ -114,83 +114,83 @@ discard block |
||
114 | 114 | break; |
115 | 115 | |
116 | 116 | case 'remove': |
117 | - if ( ! current_user_can( 'remove_users' ) ) { |
|
118 | - wp_die( __( 'Sorry, you are not allowed to remove users.' ) ); |
|
117 | + if ( ! current_user_can('remove_users')) { |
|
118 | + wp_die(__('Sorry, you are not allowed to remove users.')); |
|
119 | 119 | } |
120 | 120 | |
121 | - check_admin_referer( 'bulk-users' ); |
|
121 | + check_admin_referer('bulk-users'); |
|
122 | 122 | |
123 | 123 | $update = 'remove'; |
124 | - if ( isset( $_REQUEST['users'] ) ) { |
|
124 | + if (isset($_REQUEST['users'])) { |
|
125 | 125 | $userids = $_REQUEST['users']; |
126 | 126 | |
127 | - foreach ( $userids as $user_id ) { |
|
127 | + foreach ($userids as $user_id) { |
|
128 | 128 | $user_id = (int) $user_id; |
129 | - remove_user_from_blog( $user_id, $id ); |
|
129 | + remove_user_from_blog($user_id, $id); |
|
130 | 130 | } |
131 | - } elseif ( isset( $_GET['user'] ) ) { |
|
132 | - remove_user_from_blog( $_GET['user'] ); |
|
131 | + } elseif (isset($_GET['user'])) { |
|
132 | + remove_user_from_blog($_GET['user']); |
|
133 | 133 | } else { |
134 | 134 | $update = 'err_remove'; |
135 | 135 | } |
136 | 136 | break; |
137 | 137 | |
138 | 138 | case 'promote': |
139 | - check_admin_referer( 'bulk-users' ); |
|
139 | + check_admin_referer('bulk-users'); |
|
140 | 140 | $editable_roles = get_editable_roles(); |
141 | - if ( empty( $editable_roles[ $_REQUEST['new_role'] ] ) ) { |
|
142 | - wp_die( __( 'Sorry, you are not allowed to give users that role.' ) ); |
|
141 | + if (empty($editable_roles[$_REQUEST['new_role']])) { |
|
142 | + wp_die(__('Sorry, you are not allowed to give users that role.')); |
|
143 | 143 | } |
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'; |
165 | 165 | } |
166 | 166 | break; |
167 | 167 | default: |
168 | - if ( ! isset( $_REQUEST['users'] ) ) { |
|
168 | + if ( ! isset($_REQUEST['users'])) { |
|
169 | 169 | break; |
170 | 170 | } |
171 | - check_admin_referer( 'bulk-users' ); |
|
171 | + check_admin_referer('bulk-users'); |
|
172 | 172 | $userids = $_REQUEST['users']; |
173 | 173 | /** This action is documented in wp-admin/network/site-themes.php */ |
174 | - $referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); |
|
174 | + $referer = apply_filters('handle_network_bulk_actions-'.get_current_screen()->id, $referer, $action, $userids, $id); |
|
175 | 175 | $update = $action; |
176 | 176 | break; |
177 | 177 | } |
178 | 178 | |
179 | - wp_safe_redirect( add_query_arg( 'update', $update, $referer ) ); |
|
179 | + wp_safe_redirect(add_query_arg('update', $update, $referer)); |
|
180 | 180 | exit(); |
181 | 181 | } |
182 | 182 | |
183 | 183 | restore_current_blog(); |
184 | 184 | |
185 | -if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { |
|
186 | - wp_safe_redirect( $referer ); |
|
185 | +if (isset($_GET['action']) && 'update-site' == $_GET['action']) { |
|
186 | + wp_safe_redirect($referer); |
|
187 | 187 | exit(); |
188 | 188 | } |
189 | 189 | |
190 | -add_screen_option( 'per_page' ); |
|
190 | +add_screen_option('per_page'); |
|
191 | 191 | |
192 | 192 | /* translators: %s: site name */ |
193 | -$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); |
|
193 | +$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname)); |
|
194 | 194 | |
195 | 195 | $parent_file = 'sites.php'; |
196 | 196 | $submenu_file = 'sites.php'; |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
204 | 204 | */ |
205 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
206 | - wp_enqueue_script( 'user-suggest' ); |
|
205 | +if ( ! wp_is_large_network('users') && apply_filters('show_network_site_users_add_existing_form', true)) |
|
206 | + wp_enqueue_script('user-suggest'); |
|
207 | 207 | |
208 | -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
|
208 | +require(ABSPATH.'wp-admin/admin-header.php'); ?> |
|
209 | 209 | |
210 | 210 | <script type="text/javascript"> |
211 | 211 | var current_site_id = <?php echo $id; ?>; |
@@ -214,58 +214,58 @@ discard block |
||
214 | 214 | |
215 | 215 | <div class="wrap"> |
216 | 216 | <h1 id="edit-site"><?php echo $title; ?></h1> |
217 | -<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> |
|
217 | +<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> |
|
218 | 218 | <?php |
219 | 219 | |
220 | -network_edit_site_nav( array( |
|
220 | +network_edit_site_nav(array( |
|
221 | 221 | 'blog_id' => $id, |
222 | 222 | 'selected' => 'site-users' |
223 | -) ); |
|
223 | +)); |
|
224 | 224 | |
225 | -if ( isset($_GET['update']) ) : |
|
226 | - switch($_GET['update']) { |
|
225 | +if (isset($_GET['update'])) : |
|
226 | + switch ($_GET['update']) { |
|
227 | 227 | case 'adduser': |
228 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
228 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User added.').'</p></div>'; |
|
229 | 229 | break; |
230 | 230 | case 'err_add_member': |
231 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
231 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('User is already a member of this site.').'</p></div>'; |
|
232 | 232 | break; |
233 | 233 | case 'err_add_notfound': |
234 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
234 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username of an existing user.').'</p></div>'; |
|
235 | 235 | break; |
236 | 236 | case 'promote': |
237 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
237 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('Changed roles.').'</p></div>'; |
|
238 | 238 | break; |
239 | 239 | case 'err_promote': |
240 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
240 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to change role.').'</p></div>'; |
|
241 | 241 | break; |
242 | 242 | case 'remove': |
243 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
243 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User removed from this site.').'</p></div>'; |
|
244 | 244 | break; |
245 | 245 | case 'err_remove': |
246 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
246 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to remove.').'</p></div>'; |
|
247 | 247 | break; |
248 | 248 | case 'newuser': |
249 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
249 | + echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User created.').'</p></div>'; |
|
250 | 250 | break; |
251 | 251 | case 'err_new': |
252 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
252 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username and email.').'</p></div>'; |
|
253 | 253 | break; |
254 | 254 | case 'err_new_dup': |
255 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
255 | + echo '<div id="message" class="error notice is-dismissible"><p>'.__('Duplicated username or email address.').'</p></div>'; |
|
256 | 256 | break; |
257 | 257 | } |
258 | 258 | endif; ?> |
259 | 259 | |
260 | 260 | <form class="search-form" method="get"> |
261 | -<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> |
|
262 | -<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
261 | +<?php $wp_list_table->search_box(__('Search Users'), 'user'); ?> |
|
262 | +<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
263 | 263 | </form> |
264 | 264 | |
265 | 265 | <?php $wp_list_table->views(); ?> |
266 | 266 | |
267 | 267 | <form method="post" action="site-users.php?action=update-site"> |
268 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
268 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
269 | 269 | |
270 | 270 | <?php $wp_list_table->display(); ?> |
271 | 271 | |
@@ -277,27 +277,27 @@ discard block |
||
277 | 277 | * |
278 | 278 | * @since 3.1.0 |
279 | 279 | */ |
280 | -do_action( 'network_site_users_after_list_table' ); |
|
280 | +do_action('network_site_users_after_list_table'); |
|
281 | 281 | |
282 | 282 | /** This filter is documented in wp-admin/network/site-users.php */ |
283 | -if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?> |
|
284 | -<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2> |
|
283 | +if (current_user_can('promote_users') && apply_filters('show_network_site_users_add_existing_form', true)) : ?> |
|
284 | +<h2 id="add-existing-user"><?php _e('Add Existing User'); ?></h2> |
|
285 | 285 | <form action="site-users.php?action=adduser" id="adduser" method="post"> |
286 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
286 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
287 | 287 | <table class="form-table"> |
288 | 288 | <tr> |
289 | - <th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th> |
|
289 | + <th scope="row"><label for="newuser"><?php _e('Username'); ?></label></th> |
|
290 | 290 | <td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td> |
291 | 291 | </tr> |
292 | 292 | <tr> |
293 | - <th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th> |
|
293 | + <th scope="row"><label for="new_role_adduser"><?php _e('Role'); ?></label></th> |
|
294 | 294 | <td><select name="new_role" id="new_role_adduser"> |
295 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
295 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
296 | 296 | </select></td> |
297 | 297 | </tr> |
298 | 298 | </table> |
299 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?> |
|
300 | - <?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?> |
|
299 | + <?php wp_nonce_field('add-user', '_wpnonce_add-user') ?> |
|
300 | + <?php submit_button(__('Add User'), 'primary', 'add-user', true, array('id' => 'submit-add-existing-user')); ?> |
|
301 | 301 | </form> |
302 | 302 | <?php endif; ?> |
303 | 303 | |
@@ -309,33 +309,33 @@ discard block |
||
309 | 309 | * |
310 | 310 | * @param bool $bool Whether to show the Add New User form. Default true. |
311 | 311 | */ |
312 | -if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?> |
|
313 | -<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2> |
|
312 | +if (current_user_can('create_users') && apply_filters('show_network_site_users_add_new_form', true)) : ?> |
|
313 | +<h2 id="add-new-user"><?php _e('Add New User'); ?></h2> |
|
314 | 314 | <form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post"> |
315 | - <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> |
|
315 | + <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> |
|
316 | 316 | <table class="form-table"> |
317 | 317 | <tr> |
318 | - <th scope="row"><label for="user_username"><?php _e( 'Username' ) ?></label></th> |
|
318 | + <th scope="row"><label for="user_username"><?php _e('Username') ?></label></th> |
|
319 | 319 | <td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td> |
320 | 320 | </tr> |
321 | 321 | <tr> |
322 | - <th scope="row"><label for="user_email"><?php _e( 'Email' ) ?></label></th> |
|
322 | + <th scope="row"><label for="user_email"><?php _e('Email') ?></label></th> |
|
323 | 323 | <td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td> |
324 | 324 | </tr> |
325 | 325 | <tr> |
326 | - <th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th> |
|
326 | + <th scope="row"><label for="new_role_newuser"><?php _e('Role'); ?></label></th> |
|
327 | 327 | <td><select name="new_role" id="new_role_newuser"> |
328 | - <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
|
328 | + <?php wp_dropdown_roles(get_option('default_role')); ?> |
|
329 | 329 | </select></td> |
330 | 330 | </tr> |
331 | 331 | <tr class="form-field"> |
332 | - <td colspan="2"><?php _e( 'A password reset link will be sent to the user via email.' ) ?></td> |
|
332 | + <td colspan="2"><?php _e('A password reset link will be sent to the user via email.') ?></td> |
|
333 | 333 | </tr> |
334 | 334 | </table> |
335 | - <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?> |
|
336 | - <?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?> |
|
335 | + <?php wp_nonce_field('add-user', '_wpnonce_add-new-user') ?> |
|
336 | + <?php submit_button(__('Add New User'), 'primary', 'add-user', true, array('id' => 'submit-add-user')); ?> |
|
337 | 337 | </form> |
338 | 338 | <?php endif; ?> |
339 | 339 | </div> |
340 | 340 | <?php |
341 | -require( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
341 | +require(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | /** Load WordPress Administration Bootstrap */ |
11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | |
13 | -if ( ! current_user_can('manage_sites') ) |
|
13 | +if ( ! current_user_can('manage_sites') ) { |
|
14 | 14 | wp_die(__('Sorry, you are not allowed to edit this site.')); |
15 | +} |
|
15 | 16 | |
16 | 17 | $wp_list_table = _get_list_table('WP_Users_List_Table'); |
17 | 18 | $wp_list_table->prepare_items(); |
@@ -48,16 +49,18 @@ discard block |
||
48 | 49 | |
49 | 50 | $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; |
50 | 51 | |
51 | -if ( ! $id ) |
|
52 | +if ( ! $id ) { |
|
52 | 53 | wp_die( __('Invalid site ID.') ); |
54 | +} |
|
53 | 55 | |
54 | 56 | $details = get_site( $id ); |
55 | 57 | if ( ! $details ) { |
56 | 58 | wp_die( __( 'The requested site does not exist.' ) ); |
57 | 59 | } |
58 | 60 | |
59 | -if ( ! can_edit_network( $details->site_id ) ) |
|
61 | +if ( ! can_edit_network( $details->site_id ) ) { |
|
60 | 62 | wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); |
63 | +} |
|
61 | 64 | |
62 | 65 | $is_main_site = is_main_site( $id ); |
63 | 66 | |
@@ -101,10 +104,11 @@ discard block |
||
101 | 104 | $newuser = $_POST['newuser']; |
102 | 105 | $user = get_user_by( 'login', $newuser ); |
103 | 106 | if ( $user && $user->exists() ) { |
104 | - if ( ! is_user_member_of_blog( $user->ID, $id ) ) |
|
105 | - add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); |
|
106 | - else |
|
107 | - $update = 'err_add_member'; |
|
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 | + } |
|
108 | 112 | } else { |
109 | 113 | $update = 'err_add_notfound'; |
110 | 114 | } |
@@ -202,8 +206,9 @@ discard block |
||
202 | 206 | * |
203 | 207 | * @param bool $bool Whether to show the Add Existing User form. Default true. |
204 | 208 | */ |
205 | -if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) |
|
209 | +if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) { |
|
206 | 210 | wp_enqueue_script( 'user-suggest' ); |
211 | +} |
|
207 | 212 | |
208 | 213 | require( ABSPATH . 'wp-admin/admin-header.php' ); ?> |
209 | 214 |
@@ -9,11 +9,13 @@ discard block |
||
9 | 9 | |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | |
12 | -if ( !is_multisite() ) |
|
12 | +if ( !is_multisite() ) { |
|
13 | 13 | wp_die( __( 'Multisite support is not enabled.' ) ); |
14 | +} |
|
14 | 15 | |
15 | -if ( ! current_user_can('read') ) |
|
16 | +if ( ! current_user_can('read') ) { |
|
16 | 17 | wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); |
18 | +} |
|
17 | 19 | |
18 | 20 | $action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash'; |
19 | 21 | |
@@ -62,11 +64,13 @@ discard block |
||
62 | 64 | echo '<p>'; |
63 | 65 | _e( 'You must be a member of at least one site to use this page.' ); |
64 | 66 | echo '</p>'; |
65 | -else : |
|
67 | +else { |
|
68 | + : |
|
66 | 69 | ?> |
67 | 70 | <form id="myblogs" method="post"> |
68 | 71 | <?php |
69 | 72 | choose_primary_blog(); |
73 | +} |
|
70 | 74 | /** |
71 | 75 | * Fires before the sites list on the My Sites screen. |
72 | 76 | * |
@@ -7,68 +7,68 @@ discard block |
||
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 | -if ( !is_multisite() ) |
|
13 | - wp_die( __( 'Multisite support is not enabled.' ) ); |
|
12 | +if ( ! is_multisite()) |
|
13 | + wp_die(__('Multisite support is not enabled.')); |
|
14 | 14 | |
15 | -if ( ! current_user_can('read') ) |
|
16 | - wp_die( __( 'Sorry, you are not allowed to access this page.' ) ); |
|
15 | +if ( ! current_user_can('read')) |
|
16 | + wp_die(__('Sorry, you are not allowed to access this page.')); |
|
17 | 17 | |
18 | -$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash'; |
|
18 | +$action = isset($_POST['action']) ? $_POST['action'] : 'splash'; |
|
19 | 19 | |
20 | -$blogs = get_blogs_of_user( $current_user->ID ); |
|
20 | +$blogs = get_blogs_of_user($current_user->ID); |
|
21 | 21 | |
22 | 22 | $updated = false; |
23 | -if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) { |
|
24 | - check_admin_referer( 'update-my-sites' ); |
|
23 | +if ('updateblogsettings' == $action && isset($_POST['primary_blog'])) { |
|
24 | + check_admin_referer('update-my-sites'); |
|
25 | 25 | |
26 | - $blog = get_site( (int) $_POST['primary_blog'] ); |
|
27 | - if ( $blog && isset( $blog->domain ) ) { |
|
28 | - update_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true ); |
|
26 | + $blog = get_site((int) $_POST['primary_blog']); |
|
27 | + if ($blog && isset($blog->domain)) { |
|
28 | + update_user_option($current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true); |
|
29 | 29 | $updated = true; |
30 | 30 | } else { |
31 | - wp_die( __( 'The primary site you chose does not exist.' ) ); |
|
31 | + wp_die(__('The primary site you chose does not exist.')); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | -$title = __( 'My Sites' ); |
|
35 | +$title = __('My Sites'); |
|
36 | 36 | $parent_file = 'index.php'; |
37 | 37 | |
38 | -get_current_screen()->add_help_tab( array( |
|
38 | +get_current_screen()->add_help_tab(array( |
|
39 | 39 | 'id' => 'overview', |
40 | 40 | 'title' => __('Overview'), |
41 | 41 | 'content' => |
42 | - '<p>' . __('This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. They can use the links under each site to visit either the front end or the dashboard for that site.') . '</p>' |
|
43 | -) ); |
|
42 | + '<p>'.__('This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. They can use the links under each site to visit either the front end or the dashboard for that site.').'</p>' |
|
43 | +)); |
|
44 | 44 | |
45 | 45 | get_current_screen()->set_help_sidebar( |
46 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
47 | - '<p>' . __('<a href="https://codex.wordpress.org/Dashboard_My_Sites_Screen">Documentation on My Sites</a>') . '</p>' . |
|
48 | - '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
|
46 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
47 | + '<p>'.__('<a href="https://codex.wordpress.org/Dashboard_My_Sites_Screen">Documentation on My Sites</a>').'</p>'. |
|
48 | + '<p>'.__('<a href="https://wordpress.org/support/">Support Forums</a>').'</p>' |
|
49 | 49 | ); |
50 | 50 | |
51 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
51 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
52 | 52 | |
53 | -if ( $updated ) { ?> |
|
54 | - <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div> |
|
53 | +if ($updated) { ?> |
|
54 | + <div id="message" class="updated notice is-dismissible"><p><strong><?php _e('Settings saved.'); ?></strong></p></div> |
|
55 | 55 | <?php } ?> |
56 | 56 | |
57 | 57 | <div class="wrap"> |
58 | 58 | <h1 class="wp-heading-inline"><?php |
59 | -echo esc_html( $title ); |
|
59 | +echo esc_html($title); |
|
60 | 60 | ?></h1> |
61 | 61 | |
62 | 62 | <?php |
63 | -if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) { |
|
63 | +if (in_array(get_site_option('registration'), array('all', 'blog'))) { |
|
64 | 64 | /** This filter is documented in wp-login.php */ |
65 | - $sign_up_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); |
|
66 | - printf( ' <a href="%s" class="page-title-action">%s</a>', esc_url( $sign_up_url ), esc_html_x( 'Add New', 'site' ) ); |
|
65 | + $sign_up_url = apply_filters('wp_signup_location', network_site_url('wp-signup.php')); |
|
66 | + printf(' <a href="%s" class="page-title-action">%s</a>', esc_url($sign_up_url), esc_html_x('Add New', 'site')); |
|
67 | 67 | } |
68 | 68 | |
69 | -if ( empty( $blogs ) ) : |
|
69 | +if (empty($blogs)) : |
|
70 | 70 | echo '<p>'; |
71 | - _e( 'You must be a member of at least one site to use this page.' ); |
|
71 | + _e('You must be a member of at least one site to use this page.'); |
|
72 | 72 | echo '</p>'; |
73 | 73 | else : |
74 | 74 | ?> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @since 3.0.0 |
85 | 85 | */ |
86 | - do_action( 'myblogs_allblogs_options' ); |
|
86 | + do_action('myblogs_allblogs_options'); |
|
87 | 87 | ?> |
88 | 88 | <br clear="all" /> |
89 | 89 | <ul class="my-sites striped"> |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | * @param string $settings_html The settings HTML markup. Default empty. |
101 | 101 | * @param object $context Context of the setting (global or site-specific). Default 'global'. |
102 | 102 | */ |
103 | - $settings_html = apply_filters( 'myblogs_options', '', 'global' ); |
|
104 | - if ( $settings_html != '' ) { |
|
105 | - echo '<h3>' . __( 'Global Settings' ) . '</h3>'; |
|
103 | + $settings_html = apply_filters('myblogs_options', '', 'global'); |
|
104 | + if ($settings_html != '') { |
|
105 | + echo '<h3>'.__('Global Settings').'</h3>'; |
|
106 | 106 | echo $settings_html; |
107 | 107 | } |
108 | - reset( $blogs ); |
|
108 | + reset($blogs); |
|
109 | 109 | |
110 | - foreach ( $blogs as $user_blog ) { |
|
110 | + foreach ($blogs as $user_blog) { |
|
111 | 111 | echo "<li>"; |
112 | 112 | echo "<h3>{$user_blog->blogname}</h3>"; |
113 | 113 | /** |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | * @param string $string The HTML site link markup. |
119 | 119 | * @param object $user_blog An object containing the site data. |
120 | 120 | */ |
121 | - echo "<p class='my-sites-actions'>" . apply_filters( 'myblogs_blog_actions', "<a href='" . esc_url( get_home_url( $user_blog->userblog_id ) ). "'>" . __( 'Visit' ) . "</a> | <a href='" . esc_url( get_admin_url( $user_blog->userblog_id ) ) . "'>" . __( 'Dashboard' ) . "</a>", $user_blog ) . "</p>"; |
|
121 | + echo "<p class='my-sites-actions'>".apply_filters('myblogs_blog_actions', "<a href='".esc_url(get_home_url($user_blog->userblog_id))."'>".__('Visit')."</a> | <a href='".esc_url(get_admin_url($user_blog->userblog_id))."'>".__('Dashboard')."</a>", $user_blog)."</p>"; |
|
122 | 122 | /** This filter is documented in wp-admin/my-sites.php */ |
123 | - echo apply_filters( 'myblogs_options', '', $user_blog ); |
|
123 | + echo apply_filters('myblogs_options', '', $user_blog); |
|
124 | 124 | echo "</li>"; |
125 | 125 | }?> |
126 | 126 | </ul> |
127 | 127 | <?php |
128 | - if ( count( $blogs ) > 1 || has_action( 'myblogs_allblogs_options' ) || has_filter( 'myblogs_options' ) ) { |
|
128 | + if (count($blogs) > 1 || has_action('myblogs_allblogs_options') || has_filter('myblogs_options')) { |
|
129 | 129 | ?><input type="hidden" name="action" value="updateblogsettings" /><?php |
130 | - wp_nonce_field( 'update-my-sites' ); |
|
130 | + wp_nonce_field('update-my-sites'); |
|
131 | 131 | submit_button(); |
132 | 132 | } |
133 | 133 | ?> |
@@ -135,4 +135,4 @@ discard block |
||
135 | 135 | <?php endif; ?> |
136 | 136 | </div> |
137 | 137 | <?php |
138 | -include( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
138 | +include(ABSPATH.'wp-admin/admin-footer.php'); |
@@ -9,35 +9,35 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | /** We are located in WordPress Administration Screens */ |
12 | -if ( ! defined( 'WP_ADMIN' ) ) { |
|
13 | - define( 'WP_ADMIN', true ); |
|
12 | +if ( ! defined('WP_ADMIN')) { |
|
13 | + define('WP_ADMIN', true); |
|
14 | 14 | } |
15 | 15 | |
16 | -if ( defined('ABSPATH') ) |
|
17 | - require_once(ABSPATH . 'wp-load.php'); |
|
16 | +if (defined('ABSPATH')) |
|
17 | + require_once(ABSPATH.'wp-load.php'); |
|
18 | 18 | else |
19 | - require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
|
19 | + require_once(dirname(dirname(__FILE__)).'/wp-load.php'); |
|
20 | 20 | |
21 | 21 | /** Allow for cross-domain requests (from the frontend). */ |
22 | 22 | send_origin_headers(); |
23 | 23 | |
24 | -require_once(ABSPATH . 'wp-admin/includes/admin.php'); |
|
24 | +require_once(ABSPATH.'wp-admin/includes/admin.php'); |
|
25 | 25 | |
26 | 26 | nocache_headers(); |
27 | 27 | |
28 | 28 | /** This action is documented in wp-admin/admin.php */ |
29 | -do_action( 'admin_init' ); |
|
29 | +do_action('admin_init'); |
|
30 | 30 | |
31 | -$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action']; |
|
31 | +$action = empty($_REQUEST['action']) ? '' : $_REQUEST['action']; |
|
32 | 32 | |
33 | -if ( ! wp_validate_auth_cookie() ) { |
|
34 | - if ( empty( $action ) ) { |
|
33 | +if ( ! wp_validate_auth_cookie()) { |
|
34 | + if (empty($action)) { |
|
35 | 35 | /** |
36 | 36 | * Fires on a non-authenticated admin post request where no action was supplied. |
37 | 37 | * |
38 | 38 | * @since 2.6.0 |
39 | 39 | */ |
40 | - do_action( 'admin_post_nopriv' ); |
|
40 | + do_action('admin_post_nopriv'); |
|
41 | 41 | } else { |
42 | 42 | /** |
43 | 43 | * Fires on a non-authenticated admin post request for the given action. |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @since 2.6.0 |
49 | 49 | */ |
50 | - do_action( "admin_post_nopriv_{$action}" ); |
|
50 | + do_action("admin_post_nopriv_{$action}"); |
|
51 | 51 | } |
52 | 52 | } else { |
53 | - if ( empty( $action ) ) { |
|
53 | + if (empty($action)) { |
|
54 | 54 | /** |
55 | 55 | * Fires on an authenticated admin post request where no action was supplied. |
56 | 56 | * |
57 | 57 | * @since 2.6.0 |
58 | 58 | */ |
59 | - do_action( 'admin_post' ); |
|
59 | + do_action('admin_post'); |
|
60 | 60 | } else { |
61 | 61 | /** |
62 | 62 | * Fires on an authenticated admin post request for the given action. |
@@ -66,6 +66,6 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @since 2.6.0 |
68 | 68 | */ |
69 | - do_action( "admin_post_{$action}" ); |
|
69 | + do_action("admin_post_{$action}"); |
|
70 | 70 | } |
71 | 71 | } |
@@ -13,10 +13,11 @@ |
||
13 | 13 | define( 'WP_ADMIN', true ); |
14 | 14 | } |
15 | 15 | |
16 | -if ( defined('ABSPATH') ) |
|
16 | +if ( defined('ABSPATH') ) { |
|
17 | 17 | require_once(ABSPATH . 'wp-load.php'); |
18 | -else |
|
18 | +} else { |
|
19 | 19 | require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
20 | +} |
|
20 | 21 | |
21 | 22 | /** Allow for cross-domain requests (from the frontend). */ |
22 | 23 | send_origin_headers(); |
@@ -9,8 +9,9 @@ discard block |
||
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 = __( 'Reading Settings' ); |
16 | 17 | $parent_file = 'options-general.php'; |
@@ -80,8 +81,9 @@ discard block |
||
80 | 81 | <?php |
81 | 82 | settings_fields( 'reading' ); |
82 | 83 | |
83 | -if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) |
|
84 | +if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) { |
|
84 | 85 | add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) ); |
86 | +} |
|
85 | 87 | ?> |
86 | 88 | |
87 | 89 | <?php if ( ! get_pages() ) : ?> |
@@ -92,9 +94,11 @@ discard block |
||
92 | 94 | update_option( 'show_on_front', 'posts' ); |
93 | 95 | endif; |
94 | 96 | |
95 | -else : |
|
97 | +else { |
|
98 | + : |
|
96 | 99 | if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) |
97 | 100 | update_option( 'show_on_front', 'posts' ); |
101 | +} |
|
98 | 102 | ?> |
99 | 103 | <table class="form-table"> |
100 | 104 | <tr> |
@@ -163,8 +167,11 @@ discard block |
||
163 | 167 | */ |
164 | 168 | do_action( 'blog_privacy_selector' ); |
165 | 169 | ?> |
166 | -<?php else : ?> |
|
167 | - <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> |
|
170 | +<?php else { |
|
171 | + : ?> |
|
172 | + <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); |
|
173 | +} |
|
174 | +?> /> |
|
168 | 175 | <?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
169 | 176 | <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> |
170 | 177 | <?php endif; ?> |
@@ -7,115 +7,115 @@ 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( __( 'Sorry, you are not allowed to manage options for this site.' ) ); |
|
12 | +if ( ! current_user_can('manage_options')) |
|
13 | + wp_die(__('Sorry, you are not allowed to manage options for this site.')); |
|
14 | 14 | |
15 | -$title = __( 'Reading Settings' ); |
|
15 | +$title = __('Reading Settings'); |
|
16 | 16 | $parent_file = 'options-general.php'; |
17 | 17 | |
18 | 18 | add_action('admin_head', 'options_reading_add_js'); |
19 | 19 | |
20 | -get_current_screen()->add_help_tab( array( |
|
20 | +get_current_screen()->add_help_tab(array( |
|
21 | 21 | 'id' => 'overview', |
22 | 22 | 'title' => __('Overview'), |
23 | - 'content' => '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' . |
|
24 | - '<p>' . sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' . |
|
25 | - '<p>' . __('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display and whether to show full text or a summary.') . '</p>' . |
|
26 | - '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', |
|
27 | -) ); |
|
23 | + 'content' => '<p>'.__('This screen contains the settings that affect the display of your content.').'</p>'. |
|
24 | + '<p>'.sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page').'</p>'. |
|
25 | + '<p>'.__('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display and whether to show full text or a summary.').'</p>'. |
|
26 | + '<p>'.__('You must click the Save Changes button at the bottom of the screen for new settings to take effect.').'</p>', |
|
27 | +)); |
|
28 | 28 | |
29 | -get_current_screen()->add_help_tab( array( |
|
29 | +get_current_screen()->add_help_tab(array( |
|
30 | 30 | 'id' => 'site-visibility', |
31 | - 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ), |
|
32 | - 'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' . |
|
33 | - '<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.' ) . '</p>', |
|
34 | -) ); |
|
31 | + 'title' => has_action('blog_privacy_selector') ? __('Site Visibility') : __('Search Engine Visibility'), |
|
32 | + 'content' => '<p>'.__('You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.').'</p>'. |
|
33 | + '<p>'.__('When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.').'</p>', |
|
34 | +)); |
|
35 | 35 | |
36 | 36 | get_current_screen()->set_help_sidebar( |
37 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
38 | - '<p>' . __('<a href="https://codex.wordpress.org/Settings_Reading_Screen">Documentation on Reading Settings</a>') . '</p>' . |
|
39 | - '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
|
37 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
38 | + '<p>'.__('<a href="https://codex.wordpress.org/Settings_Reading_Screen">Documentation on Reading Settings</a>').'</p>'. |
|
39 | + '<p>'.__('<a href="https://wordpress.org/support/">Support Forums</a>').'</p>' |
|
40 | 40 | ); |
41 | 41 | |
42 | -include( ABSPATH . 'wp-admin/admin-header.php' ); |
|
42 | +include(ABSPATH.'wp-admin/admin-header.php'); |
|
43 | 43 | ?> |
44 | 44 | |
45 | 45 | <div class="wrap"> |
46 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
46 | +<h1><?php echo esc_html($title); ?></h1> |
|
47 | 47 | |
48 | 48 | <form method="post" action="options.php"> |
49 | 49 | <?php |
50 | -settings_fields( 'reading' ); |
|
50 | +settings_fields('reading'); |
|
51 | 51 | |
52 | -if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) |
|
53 | - add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) ); |
|
52 | +if ( ! in_array(get_option('blog_charset'), array('utf8', 'utf-8', 'UTF8', 'UTF-8'))) |
|
53 | + add_settings_field('blog_charset', __('Encoding for pages and feeds'), 'options_reading_blog_charset', 'reading', 'default', array('label_for' => 'blog_charset')); |
|
54 | 54 | ?> |
55 | 55 | |
56 | -<?php if ( ! get_pages() ) : ?> |
|
56 | +<?php if ( ! get_pages()) : ?> |
|
57 | 57 | <input name="show_on_front" type="hidden" value="posts" /> |
58 | 58 | <table class="form-table"> |
59 | 59 | <?php |
60 | - if ( 'posts' != get_option( 'show_on_front' ) ) : |
|
61 | - update_option( 'show_on_front', 'posts' ); |
|
60 | + if ('posts' != get_option('show_on_front')) : |
|
61 | + update_option('show_on_front', 'posts'); |
|
62 | 62 | endif; |
63 | 63 | |
64 | 64 | else : |
65 | - if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) |
|
66 | - update_option( 'show_on_front', 'posts' ); |
|
65 | + if ('page' == get_option('show_on_front') && ! get_option('page_on_front') && ! get_option('page_for_posts')) |
|
66 | + update_option('show_on_front', 'posts'); |
|
67 | 67 | ?> |
68 | 68 | <table class="form-table"> |
69 | 69 | <tr> |
70 | -<th scope="row"><?php _e( 'Front page displays' ); ?></th> |
|
71 | -<td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Front page displays' ); ?></span></legend> |
|
70 | +<th scope="row"><?php _e('Front page displays'); ?></th> |
|
71 | +<td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e('Front page displays'); ?></span></legend> |
|
72 | 72 | <p><label> |
73 | - <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> /> |
|
74 | - <?php _e( 'Your latest posts' ); ?> |
|
73 | + <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> /> |
|
74 | + <?php _e('Your latest posts'); ?> |
|
75 | 75 | </label> |
76 | 76 | </p> |
77 | 77 | <p><label> |
78 | - <input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> /> |
|
79 | - <?php printf( __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?> |
|
78 | + <input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> /> |
|
79 | + <?php printf(__('A <a href="%s">static page</a> (select below)'), 'edit.php?post_type=page'); ?> |
|
80 | 80 | </label> |
81 | 81 | </p> |
82 | 82 | <ul> |
83 | - <li><label for="page_on_front"><?php printf( __( 'Front page: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ) ) ) ); ?></label></li> |
|
84 | - <li><label for="page_for_posts"><?php printf( __( 'Posts page: %s' ), wp_dropdown_pages( array( 'name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li> |
|
83 | + <li><label for="page_on_front"><?php printf(__('Front page: %s'), wp_dropdown_pages(array('name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __('— Select —'), 'option_none_value' => '0', 'selected' => get_option('page_on_front')))); ?></label></li> |
|
84 | + <li><label for="page_for_posts"><?php printf(__('Posts page: %s'), wp_dropdown_pages(array('name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __('— Select —'), 'option_none_value' => '0', 'selected' => get_option('page_for_posts')))); ?></label></li> |
|
85 | 85 | </ul> |
86 | -<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?> |
|
87 | -<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div> |
|
86 | +<?php if ('page' == get_option('show_on_front') && get_option('page_for_posts') == get_option('page_on_front')) : ?> |
|
87 | +<div id="front-page-warning" class="error inline"><p><?php _e('<strong>Warning:</strong> these pages should not be the same!'); ?></p></div> |
|
88 | 88 | <?php endif; ?> |
89 | 89 | </fieldset></td> |
90 | 90 | </tr> |
91 | 91 | <?php endif; ?> |
92 | 92 | <tr> |
93 | -<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th> |
|
93 | +<th scope="row"><label for="posts_per_page"><?php _e('Blog pages show at most'); ?></label></th> |
|
94 | 94 | <td> |
95 | -<input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?> |
|
95 | +<input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" class="small-text" /> <?php _e('posts'); ?> |
|
96 | 96 | </td> |
97 | 97 | </tr> |
98 | 98 | <tr> |
99 | -<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th> |
|
100 | -<td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td> |
|
99 | +<th scope="row"><label for="posts_per_rss"><?php _e('Syndication feeds show the most recent'); ?></label></th> |
|
100 | +<td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" class="small-text" /> <?php _e('items'); ?></td> |
|
101 | 101 | </tr> |
102 | 102 | <tr> |
103 | -<th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th> |
|
104 | -<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend> |
|
105 | -<p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br /> |
|
106 | -<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p> |
|
103 | +<th scope="row"><?php _e('For each article in a feed, show'); ?> </th> |
|
104 | +<td><fieldset><legend class="screen-reader-text"><span><?php _e('For each article in a feed, show'); ?> </span></legend> |
|
105 | +<p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_option('rss_use_excerpt')); ?> /> <?php _e('Full text'); ?></label><br /> |
|
106 | +<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_option('rss_use_excerpt')); ?> /> <?php _e('Summary'); ?></label></p> |
|
107 | 107 | </fieldset></td> |
108 | 108 | </tr> |
109 | 109 | |
110 | 110 | <tr class="option-site-visibility"> |
111 | -<th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th> |
|
112 | -<td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> |
|
113 | -<?php if ( has_action( 'blog_privacy_selector' ) ) : ?> |
|
111 | +<th scope="row"><?php has_action('blog_privacy_selector') ? _e('Site Visibility') : _e('Search Engine Visibility'); ?> </th> |
|
112 | +<td><fieldset><legend class="screen-reader-text"><span><?php has_action('blog_privacy_selector') ? _e('Site Visibility') : _e('Search Engine Visibility'); ?> </span></legend> |
|
113 | +<?php if (has_action('blog_privacy_selector')) : ?> |
|
114 | 114 | <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> /> |
115 | - <label for="blog-public"><?php _e( 'Allow search engines to index this site' );?></label><br/> |
|
115 | + <label for="blog-public"><?php _e('Allow search engines to index this site'); ?></label><br/> |
|
116 | 116 | <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> |
117 | - <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
118 | - <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.' ); ?></p> |
|
117 | + <label for="blog-norobots"><?php _e('Discourage search engines from indexing this site'); ?></label> |
|
118 | + <p class="description"><?php _e('Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.'); ?></p> |
|
119 | 119 | <?php |
120 | 120 | /** |
121 | 121 | * Enable the legacy 'Site Visibility' privacy options. |
@@ -130,22 +130,22 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @since 2.1.0 |
132 | 132 | */ |
133 | - do_action( 'blog_privacy_selector' ); |
|
133 | + do_action('blog_privacy_selector'); |
|
134 | 134 | ?> |
135 | 135 | <?php else : ?> |
136 | - <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> |
|
137 | - <?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
138 | - <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> |
|
136 | + <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> |
|
137 | + <?php _e('Discourage search engines from indexing this site'); ?></label> |
|
138 | + <p class="description"><?php _e('It is up to search engines to honor this request.'); ?></p> |
|
139 | 139 | <?php endif; ?> |
140 | 140 | </fieldset></td> |
141 | 141 | </tr> |
142 | 142 | |
143 | -<?php do_settings_fields( 'reading', 'default' ); ?> |
|
143 | +<?php do_settings_fields('reading', 'default'); ?> |
|
144 | 144 | </table> |
145 | 145 | |
146 | -<?php do_settings_sections( 'reading' ); ?> |
|
146 | +<?php do_settings_sections('reading'); ?> |
|
147 | 147 | |
148 | 148 | <?php submit_button(); ?> |
149 | 149 | </form> |
150 | 150 | </div> |
151 | -<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?> |
|
151 | +<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?> |
@@ -10,18 +10,18 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | /** Load WordPress Administration Bootstrap */ |
13 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
13 | +require_once(dirname(__FILE__).'/admin.php'); |
|
14 | 14 | |
15 | -wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) ); |
|
15 | +wp_reset_vars(array('action', 'cat_id', 'link_id')); |
|
16 | 16 | |
17 | -if ( ! current_user_can('manage_links') ) |
|
17 | +if ( ! current_user_can('manage_links')) |
|
18 | 18 | wp_link_manager_disabled_message(); |
19 | 19 | |
20 | -if ( !empty($_POST['deletebookmarks']) ) |
|
20 | +if ( ! empty($_POST['deletebookmarks'])) |
|
21 | 21 | $action = 'deletebookmarks'; |
22 | -if ( !empty($_POST['move']) ) |
|
22 | +if ( ! empty($_POST['move'])) |
|
23 | 23 | $action = 'move'; |
24 | -if ( !empty($_POST['linkcheck']) ) |
|
24 | +if ( ! empty($_POST['linkcheck'])) |
|
25 | 25 | $linkcheck = $_POST['linkcheck']; |
26 | 26 | |
27 | 27 | $this_file = admin_url('link-manager.php'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | foreach ($linkcheck as $link_id) { |
41 | 41 | $link_id = (int) $link_id; |
42 | 42 | |
43 | - if ( wp_delete_link($link_id) ) |
|
43 | + if (wp_delete_link($link_id)) |
|
44 | 44 | $deleted++; |
45 | 45 | } |
46 | 46 | |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | check_admin_referer('add-bookmark'); |
69 | 69 | |
70 | 70 | $redir = wp_get_referer(); |
71 | - if ( add_link() ) |
|
72 | - $redir = add_query_arg( 'added', 'true', $redir ); |
|
71 | + if (add_link()) |
|
72 | + $redir = add_query_arg('added', 'true', $redir); |
|
73 | 73 | |
74 | - wp_redirect( $redir ); |
|
74 | + wp_redirect($redir); |
|
75 | 75 | exit; |
76 | 76 | |
77 | 77 | case 'save' : |
78 | 78 | $link_id = (int) $_POST['link_id']; |
79 | - check_admin_referer('update-bookmark_' . $link_id); |
|
79 | + check_admin_referer('update-bookmark_'.$link_id); |
|
80 | 80 | |
81 | 81 | edit_link($link_id); |
82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | case 'delete' : |
87 | 87 | $link_id = (int) $_GET['link_id']; |
88 | - check_admin_referer('delete-bookmark_' . $link_id); |
|
88 | + check_admin_referer('delete-bookmark_'.$link_id); |
|
89 | 89 | |
90 | 90 | wp_delete_link($link_id); |
91 | 91 | |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | wp_enqueue_script('link'); |
97 | 97 | wp_enqueue_script('xfn'); |
98 | 98 | |
99 | - if ( wp_is_mobile() ) |
|
100 | - wp_enqueue_script( 'jquery-touch-punch' ); |
|
99 | + if (wp_is_mobile()) |
|
100 | + wp_enqueue_script('jquery-touch-punch'); |
|
101 | 101 | |
102 | 102 | $parent_file = 'link-manager.php'; |
103 | 103 | $submenu_file = 'link-manager.php'; |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | $link_id = (int) $_GET['link_id']; |
107 | 107 | |
108 | - if (!$link = get_link_to_edit($link_id)) |
|
108 | + if ( ! $link = get_link_to_edit($link_id)) |
|
109 | 109 | wp_die(__('Link not found.')); |
110 | 110 | |
111 | - include( ABSPATH . 'wp-admin/edit-link-form.php' ); |
|
112 | - include( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
111 | + include(ABSPATH.'wp-admin/edit-link-form.php'); |
|
112 | + include(ABSPATH.'wp-admin/admin-footer.php'); |
|
113 | 113 | break; |
114 | 114 | |
115 | 115 | default : |
@@ -14,15 +14,19 @@ discard block |
||
14 | 14 | |
15 | 15 | wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) ); |
16 | 16 | |
17 | -if ( ! current_user_can('manage_links') ) |
|
17 | +if ( ! current_user_can('manage_links') ) { |
|
18 | 18 | wp_link_manager_disabled_message(); |
19 | +} |
|
19 | 20 | |
20 | -if ( !empty($_POST['deletebookmarks']) ) |
|
21 | +if ( !empty($_POST['deletebookmarks']) ) { |
|
21 | 22 | $action = 'deletebookmarks'; |
22 | -if ( !empty($_POST['move']) ) |
|
23 | +} |
|
24 | +if ( !empty($_POST['move']) ) { |
|
23 | 25 | $action = 'move'; |
24 | -if ( !empty($_POST['linkcheck']) ) |
|
26 | +} |
|
27 | +if ( !empty($_POST['linkcheck']) ) { |
|
25 | 28 | $linkcheck = $_POST['linkcheck']; |
29 | +} |
|
26 | 30 | |
27 | 31 | $this_file = admin_url('link-manager.php'); |
28 | 32 | |
@@ -40,8 +44,9 @@ discard block |
||
40 | 44 | foreach ($linkcheck as $link_id) { |
41 | 45 | $link_id = (int) $link_id; |
42 | 46 | |
43 | - if ( wp_delete_link($link_id) ) |
|
44 | - $deleted++; |
|
47 | + if ( wp_delete_link($link_id) ) { |
|
48 | + $deleted++; |
|
49 | + } |
|
45 | 50 | } |
46 | 51 | |
47 | 52 | wp_redirect("$this_file?deleted=$deleted"); |
@@ -68,8 +73,9 @@ discard block |
||
68 | 73 | check_admin_referer('add-bookmark'); |
69 | 74 | |
70 | 75 | $redir = wp_get_referer(); |
71 | - if ( add_link() ) |
|
72 | - $redir = add_query_arg( 'added', 'true', $redir ); |
|
76 | + if ( add_link() ) { |
|
77 | + $redir = add_query_arg( 'added', 'true', $redir ); |
|
78 | + } |
|
73 | 79 | |
74 | 80 | wp_redirect( $redir ); |
75 | 81 | exit; |
@@ -96,8 +102,9 @@ discard block |
||
96 | 102 | wp_enqueue_script('link'); |
97 | 103 | wp_enqueue_script('xfn'); |
98 | 104 | |
99 | - if ( wp_is_mobile() ) |
|
100 | - wp_enqueue_script( 'jquery-touch-punch' ); |
|
105 | + if ( wp_is_mobile() ) { |
|
106 | + wp_enqueue_script( 'jquery-touch-punch' ); |
|
107 | + } |
|
101 | 108 | |
102 | 109 | $parent_file = 'link-manager.php'; |
103 | 110 | $submenu_file = 'link-manager.php'; |
@@ -105,8 +112,9 @@ discard block |
||
105 | 112 | |
106 | 113 | $link_id = (int) $_GET['link_id']; |
107 | 114 | |
108 | - if (!$link = get_link_to_edit($link_id)) |
|
109 | - wp_die(__('Link not found.')); |
|
115 | + if (!$link = get_link_to_edit($link_id)) { |
|
116 | + wp_die(__('Link not found.')); |
|
117 | + } |
|
110 | 118 | |
111 | 119 | include( ABSPATH . 'wp-admin/edit-link-form.php' ); |
112 | 120 | include( ABSPATH . 'wp-admin/admin-footer.php' ); |