Completed
Push — master ( a7cd2a...eabd6c )
by Stephen
38:42
created
src/wp-admin/admin-post.php 3 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,35 +9,35 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,10 +13,11 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * WordPress Generic Request (POST/GET) Handler
4
- *
5
- * Intended for form submission handling in themes and plugins.
6
- *
7
- * @package WordPress
8
- * @subpackage Administration
9
- */
3
+	 * WordPress Generic Request (POST/GET) Handler
4
+	 *
5
+	 * Intended for form submission handling in themes and plugins.
6
+	 *
7
+	 * @package WordPress
8
+	 * @subpackage Administration
9
+	 */
10 10
 
11 11
 /** We are located in WordPress Administration Screens */
12 12
 if ( ! defined( 'WP_ADMIN' ) ) {
Please login to merge, or discard this patch.
src/wp-admin/options-reading.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Reading settings administration panel.
4
- *
5
- * @package WordPress
6
- * @subpackage Administration
7
- */
3
+	 * Reading settings administration panel.
4
+	 *
5
+	 * @package WordPress
6
+	 * @subpackage Administration
7
+	 */
8 8
 
9 9
 /** WordPress Administration Bootstrap */
10 10
 require_once( dirname( __FILE__ ) . '/admin.php' );
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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; ?>
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -7,115 +7,115 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** WordPress Administration Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12
-if ( ! current_user_can( 'manage_options' ) )
13
-	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
12
+if ( ! current_user_can('manage_options'))
13
+	wp_die(__('You do not have sufficient permissions to manage options for this site.'));
14 14
 
15
-$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&#8217;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&#8217;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 &#8220;Discourage search engines from indexing this site&#8221; 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, &#8220;Search Engines Discouraged,&#8221; 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 &#8220;Discourage search engines from indexing this site&#8221; 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, &#8220;Search Engines Discouraged,&#8221; 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" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
39
-	'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
37
+	'<p><strong>'.__('For more information:').'</strong></p>'.
38
+	'<p>'.__('<a href="https://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>').'</p>'.
39
+	'<p>'.__('<a href="https://wordpress.org/support/" target="_blank">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' => __( '&mdash; Select &mdash;' ), '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' => __( '&mdash; Select &mdash;' ), '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' => __('&mdash; Select &mdash;'), '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' => __('&mdash; Select &mdash;'), '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 &mdash; 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 &mdash; 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
 block discarded – undo
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'); ?>
Please login to merge, or discard this patch.
src/wp-admin/link.php 3 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,18 +10,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 :
Please login to merge, or discard this patch.
Braces   +20 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,15 +14,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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' );
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Manage link administration actions.
4
- *
5
- * This page is accessed by the link management pages and handles the forms and
6
- * AJAX processes for link actions.
7
- *
8
- * @package WordPress
9
- * @subpackage Administration
10
- */
3
+		 * Manage link administration actions.
4
+		 *
5
+		 * This page is accessed by the link management pages and handles the forms and
6
+		 * AJAX processes for link actions.
7
+		 *
8
+		 * @package WordPress
9
+		 * @subpackage Administration
10
+		 */
11 11
 
12 12
 /** Load WordPress Administration Bootstrap */
13 13
 require_once( dirname( __FILE__ ) . '/admin.php' );
Please login to merge, or discard this patch.
src/wp-admin/options-discussion.php 3 patches
Braces   +29 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 /** WordPress Administration Bootstrap */
9 9
 require_once( dirname( __FILE__ ) . '/admin.php' );
10 10
 
11
-if ( ! current_user_can( 'manage_options' ) )
11
+if ( ! current_user_can( 'manage_options' ) ) {
12 12
 	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
13
+}
13 14
 
14 15
 $title = __('Discussion Settings');
15 16
 $parent_file = 'options-general.php';
@@ -83,7 +84,10 @@  discard block
 block discarded – undo
83 84
 <label for="comment_registration">
84 85
 <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
85 86
 <?php _e('Users must be registered and logged in to comment'); ?>
86
-<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); ?>
87
+<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) {
88
+	echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' );
89
+}
90
+?>
87 91
 </label>
88 92
 <br />
89 93
 
@@ -107,7 +111,9 @@  discard block
 block discarded – undo
107 111
 $thread_comments_depth = '</label><label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
108 112
 for ( $i = 2; $i <= $maxdeep; $i++ ) {
109 113
 	$thread_comments_depth .= "<option value='" . esc_attr($i) . "'";
110
-	if ( get_option('thread_comments_depth') == $i ) $thread_comments_depth .= " selected='selected'";
114
+	if ( get_option('thread_comments_depth') == $i ) {
115
+		$thread_comments_depth .= " selected='selected'";
116
+	}
111 117
 	$thread_comments_depth .= ">$i</option>";
112 118
 }
113 119
 $thread_comments_depth .= '</select>';
@@ -121,9 +127,13 @@  discard block
 block discarded – undo
121 127
 <?php
122 128
 
123 129
 $default_comments_page = '</label><label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
124
-if ( 'newest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
130
+if ( 'newest' == get_option('default_comments_page') ) {
131
+	$default_comments_page .= ' selected="selected"';
132
+}
125 133
 $default_comments_page .= '>' . __('last') . '</option><option value="oldest"';
126
-if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
134
+if ( 'oldest' == get_option('default_comments_page') ) {
135
+	$default_comments_page .= ' selected="selected"';
136
+}
127 137
 $default_comments_page .= '>' . __('first') . '</option></select>';
128 138
 
129 139
 printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
@@ -133,9 +143,13 @@  discard block
 block discarded – undo
133 143
 <label for="comment_order"><?php
134 144
 
135 145
 $comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
136
-if ( 'asc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
146
+if ( 'asc' == get_option('comment_order') ) {
147
+	$comment_order .= ' selected="selected"';
148
+}
137 149
 $comment_order .= '>' . __('older') . '</option><option value="desc"';
138
-if ( 'desc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
150
+if ( 'desc' == get_option('comment_order') ) {
151
+	$comment_order .= ' selected="selected"';
152
+}
139 153
 $comment_order .= '>' . __('newer') . '</option></select>';
140 154
 
141 155
 printf( __('Comments should be displayed with the %s comments at the top of each page'), $comment_order );
@@ -208,7 +222,10 @@  discard block
 block discarded – undo
208 222
 	</label>
209 223
 </fieldset></td>
210 224
 </tr>
211
-<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
225
+<tr class="avatar-settings<?php if ( ! $show_avatars ) {
226
+	echo ' hide-if-js';
227
+}
228
+?>">
212 229
 <th scope="row"><?php _e('Maximum Rating'); ?></th>
213 230
 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
214 231
 
@@ -231,7 +248,10 @@  discard block
 block discarded – undo
231 248
 
232 249
 </fieldset></td>
233 250
 </tr>
234
-<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
251
+<tr class="avatar-settings<?php if ( ! $show_avatars ) {
252
+	echo ' hide-if-js';
253
+}
254
+?>">
235 255
 <th scope="row"><?php _e('Default Avatar'); ?></th>
236 256
 <td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
237 257
 
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Discussion settings administration panel.
4
- *
5
- * @package WordPress
6
- * @subpackage Administration
7
- */
3
+	 * Discussion settings administration panel.
4
+	 *
5
+	 * @package WordPress
6
+	 * @subpackage Administration
7
+	 */
8 8
 /** WordPress Administration Bootstrap */
9 9
 require_once( dirname( __FILE__ ) . '/admin.php' );
10 10
 
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
 	'retro' => __('Retro (Generated)')
230 230
 );
231 231
 /**
232
- * Filter the default avatars.
233
- *
234
- * Avatars are stored in key/value pairs, where the key is option value,
235
- * and the name is the displayed avatar name.
236
- *
237
- * @since 2.6.0
238
- *
239
- * @param array $avatar_defaults Array of default avatars.
240
- */
232
+	 * Filter the default avatars.
233
+	 *
234
+	 * Avatars are stored in key/value pairs, where the key is option value,
235
+	 * and the name is the displayed avatar name.
236
+	 *
237
+	 * @since 2.6.0
238
+	 *
239
+	 * @param array $avatar_defaults Array of default avatars.
240
+	 */
241 241
 $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
242 242
 $default = get_option( 'avatar_default', 'mystery' );
243 243
 $size = 32;
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -6,34 +6,34 @@  discard block
 block discarded – undo
6 6
  * @subpackage Administration
7 7
  */
8 8
 /** WordPress Administration Bootstrap */
9
-require_once( dirname( __FILE__ ) . '/admin.php' );
9
+require_once(dirname(__FILE__).'/admin.php');
10 10
 
11
-if ( ! current_user_can( 'manage_options' ) )
12
-	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
11
+if ( ! current_user_can('manage_options'))
12
+	wp_die(__('You do not have sufficient permissions to manage options for this site.'));
13 13
 
14 14
 $title = __('Discussion Settings');
15 15
 $parent_file = 'options-general.php';
16 16
 
17
-add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );
17
+add_action('admin_print_footer_scripts', 'options_discussion_add_js');
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
-	'content' => '<p>' . __('This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won&#8217;t all fit here! :) Use the documentation links to get information on what each discussion setting does.') . '</p>' .
23
-		'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
24
-) );
22
+	'content' => '<p>'.__('This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won&#8217;t all fit here! :) Use the documentation links to get information on what each discussion setting does.').'</p>'.
23
+		'<p>'.__('You must click the Save Changes button at the bottom of the screen for new settings to take effect.').'</p>',
24
+));
25 25
 
26 26
 get_current_screen()->set_help_sidebar(
27
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
28
-	'<p>' . __('<a href="https://codex.wordpress.org/Settings_Discussion_Screen" target="_blank">Documentation on Discussion Settings</a>') . '</p>' .
29
-	'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
27
+	'<p><strong>'.__('For more information:').'</strong></p>'.
28
+	'<p>'.__('<a href="https://codex.wordpress.org/Settings_Discussion_Screen" target="_blank">Documentation on Discussion Settings</a>').'</p>'.
29
+	'<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>'
30 30
 );
31 31
 
32
-include( ABSPATH . 'wp-admin/admin-header.php' );
32
+include(ABSPATH.'wp-admin/admin-header.php');
33 33
 ?>
34 34
 
35 35
 <div class="wrap">
36
-<h1><?php echo esc_html( $title ); ?></h1>
36
+<h1><?php echo esc_html($title); ?></h1>
37 37
 
38 38
 <form method="post" action="options.php">
39 39
 <?php settings_fields('discussion'); ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />
55 55
 <?php _e('Allow people to post comments on new articles'); ?></label>
56 56
 <br />
57
-<p class="description"><?php echo '(' . __( 'These settings may be overridden for individual articles.' ) . ')'; ?></p>
57
+<p class="description"><?php echo '('.__('These settings may be overridden for individual articles.').')'; ?></p>
58 58
 </fieldset></td>
59 59
 </tr>
60 60
 <tr>
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 <label for="comment_registration">
66 66
 <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
67 67
 <?php _e('Users must be registered and logged in to comment'); ?>
68
-<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); ?>
68
+<?php if ( ! get_option('users_can_register') && is_multisite()) echo ' '.__('(Signup has been disabled. Only members of this site can comment.)'); ?>
69 69
 </label>
70 70
 <br />
71 71
 
72 72
 <label for="close_comments_for_old_posts">
73 73
 <input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked('1', get_option('close_comments_for_old_posts')); ?> />
74
-<?php printf( __('Automatically close comments on articles older than %s days'), '</label><label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr(get_option('close_comments_days_old')) . '" class="small-text" />'); ?>
74
+<?php printf(__('Automatically close comments on articles older than %s days'), '</label><label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="'.esc_attr(get_option('close_comments_days_old')).'" class="small-text" />'); ?>
75 75
 </label>
76 76
 <br />
77 77
 <label for="thread_comments">
@@ -84,42 +84,42 @@  discard block
 block discarded – undo
84 84
  *
85 85
  * @param int $max_depth The maximum depth of threaded comments. Default 10.
86 86
  */
87
-$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
87
+$maxdeep = (int) apply_filters('thread_comments_depth_max', 10);
88 88
 
89 89
 $thread_comments_depth = '</label><label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
90
-for ( $i = 2; $i <= $maxdeep; $i++ ) {
91
-	$thread_comments_depth .= "<option value='" . esc_attr($i) . "'";
92
-	if ( get_option('thread_comments_depth') == $i ) $thread_comments_depth .= " selected='selected'";
90
+for ($i = 2; $i <= $maxdeep; $i++) {
91
+	$thread_comments_depth .= "<option value='".esc_attr($i)."'";
92
+	if (get_option('thread_comments_depth') == $i) $thread_comments_depth .= " selected='selected'";
93 93
 	$thread_comments_depth .= ">$i</option>";
94 94
 }
95 95
 $thread_comments_depth .= '</select>';
96 96
 
97
-printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth );
97
+printf(__('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth);
98 98
 
99 99
 ?></label>
100 100
 <br />
101 101
 <label for="page_comments">
102
-<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> />
102
+<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked('1', get_option('page_comments')); ?> />
103 103
 <?php
104 104
 $default_comments_page = '</label><label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
105
-if ( 'newest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
106
-$default_comments_page .= '>' . __('last') . '</option><option value="oldest"';
107
-if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
108
-$default_comments_page .= '>' . __('first') . '</option></select>';
105
+if ('newest' == get_option('default_comments_page')) $default_comments_page .= ' selected="selected"';
106
+$default_comments_page .= '>'.__('last').'</option><option value="oldest"';
107
+if ('oldest' == get_option('default_comments_page')) $default_comments_page .= ' selected="selected"';
108
+$default_comments_page .= '>'.__('first').'</option></select>';
109 109
 
110
-printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
110
+printf(__('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="'.esc_attr(get_option('comments_per_page')).'" class="small-text" />', $default_comments_page);
111 111
 
112 112
 ?></label>
113 113
 <br />
114 114
 <label for="comment_order"><?php
115 115
 
116 116
 $comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
117
-if ( 'asc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
118
-$comment_order .= '>' . __('older') . '</option><option value="desc"';
119
-if ( 'desc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
120
-$comment_order .= '>' . __('newer') . '</option></select>';
117
+if ('asc' == get_option('comment_order')) $comment_order .= ' selected="selected"';
118
+$comment_order .= '>'.__('older').'</option><option value="desc"';
119
+if ('desc' == get_option('comment_order')) $comment_order .= ' selected="selected"';
120
+$comment_order .= '>'.__('newer').'</option></select>';
121 121
 
122
-printf( __('Comments should be displayed with the %s comments at the top of each page'), $comment_order );
122
+printf(__('Comments should be displayed with the %s comments at the top of each page'), $comment_order);
123 123
 
124 124
 ?></label>
125 125
 </fieldset></td>
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 <tr>
150 150
 <th scope="row"><?php _e('Comment Moderation'); ?></th>
151 151
 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Moderation'); ?></span></legend>
152
-<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr(get_option('comment_max_links')) . '" class="small-text" />' ); ?></label></p>
152
+<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="'.esc_attr(get_option('comment_max_links')).'" class="small-text" />'); ?></label></p>
153 153
 
154 154
 <p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, email, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.'); ?></label></p>
155 155
 <p>
156
-<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
156
+<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea(get_option('moderation_keys')); ?></textarea>
157 157
 </p>
158 158
 </fieldset></td>
159 159
 </tr>
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Blacklist'); ?></span></legend>
163 163
 <p><label for="blacklist_keys"><?php _e('When a comment contains any of these words in its content, name, URL, email, or IP, it will be put in the trash. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.'); ?></label></p>
164 164
 <p>
165
-<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php echo esc_textarea( get_option( 'blacklist_keys' ) ); ?></textarea>
165
+<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php echo esc_textarea(get_option('blacklist_keys')); ?></textarea>
166 166
 </p>
167 167
 </fieldset></td>
168 168
 </tr>
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 <?php
177 177
 // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that?
178 178
 
179
-$show_avatars = get_option( 'show_avatars' );
179
+$show_avatars = get_option('show_avatars');
180 180
 ?>
181 181
 
182 182
 <table class="form-table">
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
 <th scope="row"><?php _e('Avatar Display'); ?></th>
185 185
 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Avatar Display'); ?></span></legend>
186 186
 	<label for="show_avatars">
187
-		<input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> />
188
-		<?php _e( 'Show Avatars' ); ?>
187
+		<input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked($show_avatars, 1); ?> />
188
+		<?php _e('Show Avatars'); ?>
189 189
 	</label>
190 190
 </fieldset></td>
191 191
 </tr>
192
-<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
192
+<tr class="avatar-settings<?php if ( ! $show_avatars) echo ' hide-if-js'; ?>">
193 193
 <th scope="row"><?php _e('Maximum Rating'); ?></th>
194 194
 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
195 195
 
@@ -206,13 +206,13 @@  discard block
 block discarded – undo
206 206
 );
207 207
 foreach ($ratings as $key => $rating) :
208 208
 	$selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : '';
209
-	echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr($key) . "' $selected/> $rating</label><br />";
209
+	echo "\n\t<label><input type='radio' name='avatar_rating' value='".esc_attr($key)."' $selected/> $rating</label><br />";
210 210
 endforeach;
211 211
 ?>
212 212
 
213 213
 </fieldset></td>
214 214
 </tr>
215
-<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
215
+<tr class="avatar-settings<?php if ( ! $show_avatars) echo ' hide-if-js'; ?>">
216 216
 <th scope="row"><?php _e('Default Avatar'); ?></th>
217 217
 <td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
218 218
 
@@ -238,28 +238,28 @@  discard block
 block discarded – undo
238 238
  *
239 239
  * @param array $avatar_defaults Array of default avatars.
240 240
  */
241
-$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
242
-$default = get_option( 'avatar_default', 'mystery' );
241
+$avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults);
242
+$default = get_option('avatar_default', 'mystery');
243 243
 $size = 32;
244 244
 $avatar_list = '';
245 245
 
246 246
 // Force avatars on to display these choices
247
-add_filter( 'pre_option_show_avatars', '__return_true', 100 );
247
+add_filter('pre_option_show_avatars', '__return_true', 100);
248 248
 
249
-foreach ( $avatar_defaults as $default_key => $default_name ) {
249
+foreach ($avatar_defaults as $default_key => $default_name) {
250 250
 	$selected = ($default == $default_key) ? 'checked="checked" ' : '';
251
-	$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> ";
251
+	$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='".esc_attr($default_key)."' {$selected}/> ";
252 252
 
253
-	$avatar = get_avatar( $user_email, $size, $default_key );
254
-	$avatar = preg_replace( "/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar );
255
-	$avatar = preg_replace( "/srcset='(.+?) 2x'/", "srcset='\$1&amp;forcedefault=1 2x'", $avatar );
253
+	$avatar = get_avatar($user_email, $size, $default_key);
254
+	$avatar = preg_replace("/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar);
255
+	$avatar = preg_replace("/srcset='(.+?) 2x'/", "srcset='\$1&amp;forcedefault=1 2x'", $avatar);
256 256
 	$avatar_list .= $avatar;
257 257
 
258
-	$avatar_list .= ' ' . $default_name . '</label>';
258
+	$avatar_list .= ' '.$default_name.'</label>';
259 259
 	$avatar_list .= '<br />';
260 260
 }
261 261
 
262
-remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
262
+remove_filter('pre_option_show_avatars', '__return_true', 100);
263 263
 
264 264
 /**
265 265
  * Filter the HTML output of the default avatar list.
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
  *
269 269
  * @param string $avatar_list HTML markup of the avatar list.
270 270
  */
271
-echo apply_filters( 'default_avatar_select', $avatar_list );
271
+echo apply_filters('default_avatar_select', $avatar_list);
272 272
 ?>
273 273
 
274 274
 </fieldset></td>
@@ -282,4 +282,4 @@  discard block
 block discarded – undo
282 282
 </form>
283 283
 </div>
284 284
 
285
-<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
285
+<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?>
Please login to merge, or discard this patch.
src/wp-admin/options-head.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
  * @subpackage Administration
9 9
  */
10 10
 
11
-wp_reset_vars( array( 'action' ) );
11
+wp_reset_vars(array('action'));
12 12
 
13
-if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
13
+if (isset($_GET['updated']) && isset($_GET['page'])) {
14 14
 	// For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
15 15
 	add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
16 16
 }
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * WordPress Options Header.
4
- *
5
- * Displays updated message, if updated variable is part of the URL query.
6
- *
7
- * @package WordPress
8
- * @subpackage Administration
9
- */
3
+	 * WordPress Options Header.
4
+	 *
5
+	 * Displays updated message, if updated variable is part of the URL query.
6
+	 *
7
+	 * @package WordPress
8
+	 * @subpackage Administration
9
+	 */
10 10
 
11 11
 wp_reset_vars( array( 'action' ) );
12 12
 
Please login to merge, or discard this patch.
src/wp-admin/moderation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,6 +7,6 @@
 block discarded – undo
7 7
  * @package WordPress
8 8
  * @subpackage Administration
9 9
  */
10
-require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
11
-wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
10
+require_once(dirname(dirname(__FILE__)).'/wp-load.php');
11
+wp_redirect(admin_url('edit-comments.php?comment_status=moderated'));
12 12
 exit;
Please login to merge, or discard this patch.
src/wp-admin/options-general.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		$right_now = time();
225 225
 		foreach ( timezone_transitions_get($date_time_zone_selected) as $tr) {
226 226
 			if ( $tr['ts'] > $right_now ) {
227
-			    $found = true;
227
+				$found = true;
228 228
 				break;
229 229
 			}
230 230
 		}
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
 	<fieldset><legend class="screen-reader-text"><span><?php _e('Date Format') ?></span></legend>
255 255
 <?php
256 256
 	/**
257
-	* Filter the default date formats.
258
-	*
259
-	* @since 2.7.0
260
-	* @since 4.0.0 Added ISO date standard YYYY-MM-DD format.
261
-	*
262
-	* @param array $default_date_formats Array of default date formats.
263
-	*/
257
+	 * Filter the default date formats.
258
+	 *
259
+	 * @since 2.7.0
260
+	 * @since 4.0.0 Added ISO date standard YYYY-MM-DD format.
261
+	 *
262
+	 * @param array $default_date_formats Array of default date formats.
263
+	 */
264 264
 	$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );
265 265
 
266 266
 	$custom = true;
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
 	<fieldset><legend class="screen-reader-text"><span><?php _e('Time Format') ?></span></legend>
289 289
 <?php
290 290
 	/**
291
-	* Filter the default time formats.
292
-	*
293
-	* @since 2.7.0
294
-	*
295
-	* @param array $default_time_formats Array of default time formats.
296
-	*/
291
+	 * Filter the default time formats.
292
+	 *
293
+	 * @since 2.7.0
294
+	 *
295
+	 * @param array $default_time_formats Array of default time formats.
296
+	 */
297 297
 	$time_formats = array_unique( apply_filters( 'time_formats', array( __( 'g:i a' ), 'g:i A', 'H:i' ) ) );
298 298
 
299 299
 	$custom = true;
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
 <td><select name="start_of_week" id="start_of_week">
323 323
 <?php
324 324
 /**
325
- * @global WP_Locale $wp_locale
326
- */
325
+	 * @global WP_Locale $wp_locale
326
+	 */
327 327
 global $wp_locale;
328 328
 
329 329
 for ($day_index = 0; $day_index <= 6; $day_index++) :
Please login to merge, or discard this patch.
Spacing   +96 added lines, -97 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** WordPress Administration Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12 12
 /** WordPress Translation Install API */
13
-require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
13
+require_once(ABSPATH.'wp-admin/includes/translation-install.php');
14 14
 
15
-if ( ! current_user_can( 'manage_options' ) )
16
-	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
15
+if ( ! current_user_can('manage_options'))
16
+	wp_die(__('You do not have sufficient permissions to manage options for this site.'));
17 17
 
18 18
 $title = __('General Settings');
19 19
 $parent_file = 'options-general.php';
@@ -22,35 +22,35 @@  discard block
 block discarded – undo
22 22
 
23 23
 add_action('admin_head', 'options_general_add_js');
24 24
 
25
-$options_help = '<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' .
26
-	'<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.') . '</p>';
25
+$options_help = '<p>'.__('The fields on this screen determine some of the basics of your site setup.').'</p>'.
26
+	'<p>'.__('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.').'</p>';
27 27
 
28
-if ( ! is_multisite() ) {
29
-	$options_help .= '<p>' . __('The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.') . '</p>' .
30
-		'<p>' . __('If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.') . '</p>';
28
+if ( ! is_multisite()) {
29
+	$options_help .= '<p>'.__('The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.').'</p>'.
30
+		'<p>'.__('If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.').'</p>';
31 31
 }
32 32
 
33
-$options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
34
-	'<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .
35
-	'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
33
+$options_help .= '<p>'.__('You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).').'</p>'.
34
+	'<p>'.__('UTC means Coordinated Universal Time.').'</p>'.
35
+	'<p>'.__('You must click the Save Changes button at the bottom of the screen for new settings to take effect.').'</p>';
36 36
 
37
-get_current_screen()->add_help_tab( array(
37
+get_current_screen()->add_help_tab(array(
38 38
 	'id'      => 'overview',
39 39
 	'title'   => __('Overview'),
40 40
 	'content' => $options_help,
41
-) );
41
+));
42 42
 
43 43
 get_current_screen()->set_help_sidebar(
44
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
45
-	'<p>' . __('<a href="https://codex.wordpress.org/Settings_General_Screen" target="_blank">Documentation on General Settings</a>') . '</p>' .
46
-	'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
44
+	'<p><strong>'.__('For more information:').'</strong></p>'.
45
+	'<p>'.__('<a href="https://codex.wordpress.org/Settings_General_Screen" target="_blank">Documentation on General Settings</a>').'</p>'.
46
+	'<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>'
47 47
 );
48 48
 
49
-include( ABSPATH . 'wp-admin/admin-header.php' );
49
+include(ABSPATH.'wp-admin/admin-header.php');
50 50
 ?>
51 51
 
52 52
 <div class="wrap">
53
-<h1><?php echo esc_html( $title ); ?></h1>
53
+<h1><?php echo esc_html($title); ?></h1>
54 54
 
55 55
 <form method="post" action="options.php" novalidate="novalidate">
56 56
 <?php settings_fields('general'); ?>
@@ -63,24 +63,24 @@  discard block
 block discarded – undo
63 63
 <tr>
64 64
 <th scope="row"><label for="blogdescription"><?php _e('Tagline') ?></label></th>
65 65
 <td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option('blogdescription'); ?>" class="regular-text" />
66
-<p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ) ?></p></td>
66
+<p class="description" id="tagline-description"><?php _e('In a few words, explain what this site is about.') ?></p></td>
67 67
 </tr>
68
-<?php if ( !is_multisite() ) { ?>
68
+<?php if ( ! is_multisite()) { ?>
69 69
 <tr>
70 70
 <th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
71
-<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
71
+<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php disabled(defined('WP_SITEURL')); ?> class="regular-text code<?php if (defined('WP_SITEURL')) echo ' disabled' ?>" /></td>
72 72
 </tr>
73 73
 <tr>
74 74
 <th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
75
-<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
76
-<?php if ( ! defined( 'WP_HOME' ) ) : ?>
77
-<p class="description" id="home-description"><?php _e( 'Enter the address here if you <a href="https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">want your site home page to be different from your WordPress installation directory.</a>' ); ?></p></td>
75
+<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option('home'); ?>"<?php disabled(defined('WP_HOME')); ?> class="regular-text code<?php if (defined('WP_HOME')) echo ' disabled' ?>" />
76
+<?php if ( ! defined('WP_HOME')) : ?>
77
+<p class="description" id="home-description"><?php _e('Enter the address here if you <a href="https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">want your site home page to be different from your WordPress installation directory.</a>'); ?></p></td>
78 78
 <?php endif; ?>
79 79
 </tr>
80 80
 <tr>
81 81
 <th scope="row"><label for="admin_email"><?php _e('Email Address') ?> </label></th>
82
-<td><input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
83
-<p class="description" id="admin-email-description"><?php _e( 'This address is used for admin purposes, like new user notification.' ) ?></p></td>
82
+<td><input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-description" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
83
+<p class="description" id="admin-email-description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td>
84 84
 </tr>
85 85
 <tr>
86 86
 <th scope="row"><?php _e('Membership') ?></th>
@@ -92,28 +92,28 @@  discard block
 block discarded – undo
92 92
 <tr>
93 93
 <th scope="row"><label for="default_role"><?php _e('New User Default Role') ?></label></th>
94 94
 <td>
95
-<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select>
95
+<select name="default_role" id="default_role"><?php wp_dropdown_roles(get_option('default_role')); ?></select>
96 96
 </td>
97 97
 </tr>
98 98
 <?php } else { ?>
99 99
 <tr>
100 100
 <th scope="row"><label for="new_admin_email"><?php _e('Email Address') ?> </label></th>
101
-<td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
102
-<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ) ?></p>
101
+<td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
102
+<p class="description" id="new-admin-email-description"><?php _e('This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></p>
103 103
 <?php
104
-$new_admin_email = get_option( 'new_admin_email' );
105
-if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
104
+$new_admin_email = get_option('new_admin_email');
105
+if ($new_admin_email && $new_admin_email != get_option('admin_email')) : ?>
106 106
 <div class="updated inline">
107 107
 <p><?php
108 108
 	printf(
109 109
 		/* translators: %s: new admin email */
110
-		__( 'There is a pending change of the admin email to %s.' ),
111
-		'<code>' . esc_html( $new_admin_email ) . '</code>'
110
+		__('There is a pending change of the admin email to %s.'),
111
+		'<code>'.esc_html($new_admin_email).'</code>'
112 112
 	);
113 113
 	printf(
114 114
 		' <a href="%1$s">%2$s</a>',
115
-		esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ),
116
-		__( 'Cancel' )
115
+		esc_url(admin_url('options.php?dismiss=new_admin_email')),
116
+		__('Cancel')
117 117
 	);
118 118
 ?></p>
119 119
 </div>
@@ -129,17 +129,17 @@  discard block
 block discarded – undo
129 129
 $check_zone_info = true;
130 130
 
131 131
 // Remove old Etc mappings. Fallback to gmt_offset.
132
-if ( false !== strpos($tzstring,'Etc/GMT') )
132
+if (false !== strpos($tzstring, 'Etc/GMT'))
133 133
 	$tzstring = '';
134 134
 
135
-if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
135
+if (empty($tzstring)) { // Create a UTC+- zone if no timezone string exists
136 136
 	$check_zone_info = false;
137
-	if ( 0 == $current_offset )
137
+	if (0 == $current_offset)
138 138
 		$tzstring = 'UTC+0';
139 139
 	elseif ($current_offset < 0)
140
-		$tzstring = 'UTC' . $current_offset;
140
+		$tzstring = 'UTC'.$current_offset;
141 141
 	else
142
-		$tzstring = 'UTC+' . $current_offset;
142
+		$tzstring = 'UTC+'.$current_offset;
143 143
 }
144 144
 
145 145
 ?>
@@ -150,34 +150,34 @@  discard block
 block discarded – undo
150 150
 <?php echo wp_timezone_choice($tzstring); ?>
151 151
 </select>
152 152
 
153
-<p class="description" id="timezone-description"><?php _e( 'Choose a city in the same timezone as you.' ); ?></p>
153
+<p class="description" id="timezone-description"><?php _e('Choose a city in the same timezone as you.'); ?></p>
154 154
 
155 155
 <p class="timezone-info">
156 156
 	<span id="utc-time"><?php
157 157
 		/* translators: 1: UTC abbreviation, 2: UTC time */
158
-		printf( __( 'Universal time (%1$s) is %2$s.' ),
159
-			'<abbr>' . __( 'UTC' ) . '</abbr>',
160
-			'<code>' . date_i18n( $timezone_format, false, 'gmt' ) . '</code>'
158
+		printf(__('Universal time (%1$s) is %2$s.'),
159
+			'<abbr>'.__('UTC').'</abbr>',
160
+			'<code>'.date_i18n($timezone_format, false, 'gmt').'</code>'
161 161
 		);
162 162
 	?></span>
163
-<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
163
+<?php if (get_option('timezone_string') || ! empty($current_offset)) : ?>
164 164
 	<span id="local-time"><?php
165 165
 		/* translators: %s: local time */
166
-		printf( __( 'Local time is %s.' ),
167
-			'<code>' . date_i18n( $timezone_format ) . '</code>'
166
+		printf(__('Local time is %s.'),
167
+			'<code>'.date_i18n($timezone_format).'</code>'
168 168
 		);
169 169
 	?></span>
170 170
 <?php endif; ?>
171 171
 </p>
172 172
 
173
-<?php if ( $check_zone_info && $tzstring ) : ?>
173
+<?php if ($check_zone_info && $tzstring) : ?>
174 174
 <p class="timezone-info">
175 175
 <span>
176 176
 	<?php
177 177
 	// Set TZ so localtime works.
178 178
 	date_default_timezone_set($tzstring);
179 179
 	$now = localtime(time(), true);
180
-	if ( $now['tm_isdst'] )
180
+	if ($now['tm_isdst'])
181 181
 		_e('This timezone is currently in daylight saving time.');
182 182
 	else
183 183
 		_e('This timezone is currently in standard time.');
@@ -186,34 +186,33 @@  discard block
 block discarded – undo
186 186
 	<?php
187 187
 	$allowed_zones = timezone_identifiers_list();
188 188
 
189
-	if ( in_array( $tzstring, $allowed_zones) ) {
189
+	if (in_array($tzstring, $allowed_zones)) {
190 190
 		$found = false;
191 191
 		$date_time_zone_selected = new DateTimeZone($tzstring);
192 192
 		$tz_offset = timezone_offset_get($date_time_zone_selected, date_create());
193 193
 		$right_now = time();
194
-		foreach ( timezone_transitions_get($date_time_zone_selected) as $tr) {
195
-			if ( $tr['ts'] > $right_now ) {
194
+		foreach (timezone_transitions_get($date_time_zone_selected) as $tr) {
195
+			if ($tr['ts'] > $right_now) {
196 196
 			    $found = true;
197 197
 				break;
198 198
 			}
199 199
 		}
200 200
 
201
-		if ( $found ) {
201
+		if ($found) {
202 202
 			echo ' ';
203 203
 			$message = $tr['isdst'] ?
204 204
 				/* translators: %s: date and time  */
205
-				__( 'Daylight saving time begins on: %s.')  :
206
-				/* translators: %s: date and time  */
207
-				__( 'Standard time begins on: %s.' );
205
+				__('Daylight saving time begins on: %s.') : /* translators: %s: date and time  */
206
+				__('Standard time begins on: %s.');
208 207
 			// Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
209
-			printf( $message,
210
-				'<code>' . date_i18n(
211
-					__( 'F j, Y' ) . ' ' . __( 'g:i a' ),
212
-					$tr['ts'] + ( $tz_offset - $tr['offset'] )
213
-				) . '</code>'
208
+			printf($message,
209
+				'<code>'.date_i18n(
210
+					__('F j, Y').' '.__('g:i a'),
211
+					$tr['ts'] + ($tz_offset - $tr['offset'])
212
+				).'</code>'
214 213
 			);
215 214
 		} else {
216
-			_e( 'This timezone does not observe daylight saving time.' );
215
+			_e('This timezone does not observe daylight saving time.');
217 216
 		}
218 217
 	}
219 218
 	// Set back to UTC.
@@ -238,25 +237,25 @@  discard block
 block discarded – undo
238 237
 	*
239 238
 	* @param array $default_date_formats Array of default date formats.
240 239
 	*/
241
-	$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );
240
+	$date_formats = array_unique(apply_filters('date_formats', array(__('F j, Y'), 'Y-m-d', 'm/d/Y', 'd/m/Y')));
242 241
 
243 242
 	$custom = true;
244 243
 
245
-	foreach ( $date_formats as $format ) {
246
-		echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
247
-		if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "==="
244
+	foreach ($date_formats as $format) {
245
+		echo "\t<label><input type='radio' name='date_format' value='".esc_attr($format)."'";
246
+		if (get_option('date_format') === $format) { // checked() uses "==" rather than "==="
248 247
 			echo " checked='checked'";
249 248
 			$custom = false;
250 249
 		}
251
-		echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
250
+		echo ' /> <span class="date-time-text format-i18n">'.date_i18n($format).'</span><code>'.esc_html($format)."</code></label><br />\n";
252 251
 	}
253 252
 
254 253
 	echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
255
-	checked( $custom );
256
-	echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></label>' .
257
-		'<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' .
258
-		'<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" /></span>' .
259
-		'<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' .
254
+	checked($custom);
255
+	echo '/> <span class="date-time-text date-time-custom-text">'.__('Custom:').'<span class="screen-reader-text"> '.__('enter a custom date format in the following field').'</span></label>'.
256
+		'<label for="date_format_custom" class="screen-reader-text">'.__('Custom date format:').'</label>'.
257
+		'<input type="text" name="date_format_custom" id="date_format_custom" value="'.esc_attr(get_option('date_format')).'" class="small-text" /></span>'.
258
+		'<span class="screen-reader-text">'.__('example:').' </span> <span class="example">'.date_i18n(get_option('date_format')).'</span>'.
260 259
 		"<span class='spinner'></span>\n";
261 260
 ?>
262 261
 	</fieldset>
@@ -274,28 +273,28 @@  discard block
 block discarded – undo
274 273
 	*
275 274
 	* @param array $default_time_formats Array of default time formats.
276 275
 	*/
277
-	$time_formats = array_unique( apply_filters( 'time_formats', array( __( 'g:i a' ), 'g:i A', 'H:i' ) ) );
276
+	$time_formats = array_unique(apply_filters('time_formats', array(__('g:i a'), 'g:i A', 'H:i')));
278 277
 
279 278
 	$custom = true;
280 279
 
281
-	foreach ( $time_formats as $format ) {
282
-		echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
283
-		if ( get_option('time_format') === $format ) { // checked() uses "==" rather than "==="
280
+	foreach ($time_formats as $format) {
281
+		echo "\t<label><input type='radio' name='time_format' value='".esc_attr($format)."'";
282
+		if (get_option('time_format') === $format) { // checked() uses "==" rather than "==="
284 283
 			echo " checked='checked'";
285 284
 			$custom = false;
286 285
 		}
287
-		echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
286
+		echo ' /> <span class="date-time-text format-i18n">'.date_i18n($format).'</span><code>'.esc_html($format)."</code></label><br />\n";
288 287
 	}
289 288
 
290 289
 	echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
291
-	checked( $custom );
292
-	echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></label>' .
293
-		'<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' .
294
-		'<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" /></span>' .
295
-		'<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' .
290
+	checked($custom);
291
+	echo '/> <span class="date-time-text date-time-custom-text">'.__('Custom:').'<span class="screen-reader-text"> '.__('enter a custom time format in the following field').'</span></label>'.
292
+		'<label for="time_format_custom" class="screen-reader-text">'.__('Custom time format:').'</label>'.
293
+		'<input type="text" name="time_format_custom" id="time_format_custom" value="'.esc_attr(get_option('time_format')).'" class="small-text" /></span>'.
294
+		'<span class="screen-reader-text">'.__('example:').' </span> <span class="example">'.date_i18n(get_option('time_format')).'</span>'.
296 295
 		"<span class='spinner'></span>\n";
297 296
 
298
-	echo "\t<p class='date-time-doc'>" . __('<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n";
297
+	echo "\t<p class='date-time-doc'>".__('<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.')."</p>\n";
299 298
 ?>
300 299
 	</fieldset>
301 300
 </td>
@@ -311,7 +310,7 @@  discard block
 block discarded – undo
311 310
 
312 311
 for ($day_index = 0; $day_index <= 6; $day_index++) :
313 312
 	$selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
314
-	echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
313
+	echo "\n\t<option value='".esc_attr($day_index)."' $selected>".$wp_locale->get_weekday($day_index).'</option>';
315 314
 endfor;
316 315
 ?>
317 316
 </select></td>
@@ -321,39 +320,39 @@  discard block
 block discarded – undo
321 320
 <?php
322 321
 $languages = get_available_languages();
323 322
 $translations = wp_get_available_translations();
324
-if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
323
+if ( ! is_multisite() && defined('WPLANG') && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array(WPLANG, $languages)) {
325 324
 	$languages[] = WPLANG;
326 325
 }
327
-if ( ! empty( $languages ) || ! empty( $translations ) ) {
326
+if ( ! empty($languages) || ! empty($translations)) {
328 327
 	?>
329 328
 	<tr>
330
-		<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
329
+		<th width="33%" scope="row"><label for="WPLANG"><?php _e('Site Language'); ?></label></th>
331 330
 		<td>
332 331
 			<?php
333 332
 			$locale = get_locale();
334
-			if ( ! in_array( $locale, $languages ) ) {
333
+			if ( ! in_array($locale, $languages)) {
335 334
 				$locale = '';
336 335
 			}
337 336
 
338
-			wp_dropdown_languages( array(
337
+			wp_dropdown_languages(array(
339 338
 				'name'         => 'WPLANG',
340 339
 				'id'           => 'WPLANG',
341 340
 				'selected'     => $locale,
342 341
 				'languages'    => $languages,
343 342
 				'translations' => $translations,
344
-				'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
345
-			) );
343
+				'show_available_translations' => ( ! is_multisite() || is_super_admin()) && wp_can_install_language_pack(),
344
+			));
346 345
 
347 346
 			// Add note about deprecated WPLANG constant.
348
-			if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
349
-				if ( is_super_admin() ) {
347
+			if (defined('WPLANG') && ('' !== WPLANG) && $locale !== WPLANG) {
348
+				if (is_super_admin()) {
350 349
 					?>
351 350
 					<p class="description">
352
-						<strong><?php _e( 'Note:' ); ?></strong> <?php printf( __( 'The %s constant in your %s file is no longer needed.' ), '<code>WPLANG</code>', '<code>wp-config.php</code>' ); ?>
351
+						<strong><?php _e('Note:'); ?></strong> <?php printf(__('The %s constant in your %s file is no longer needed.'), '<code>WPLANG</code>', '<code>wp-config.php</code>'); ?>
353 352
 					</p>
354 353
 					<?php
355 354
 				}
356
-				_deprecated_argument( 'define()', '4.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
355
+				_deprecated_argument('define()', '4.0', sprintf(__('The %s constant in your %s file is no longer needed.'), 'WPLANG', 'wp-config.php'));
357 356
 			}
358 357
 			?>
359 358
 		</td>
@@ -370,4 +369,4 @@  discard block
 block discarded – undo
370 369
 
371 370
 </div>
372 371
 
373
-<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
372
+<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?>
Please login to merge, or discard this patch.
Braces   +26 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,8 +12,9 @@  discard block
 block discarded – undo
12 12
 /** WordPress Translation Install API */
13 13
 require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
14 14
 
15
-if ( ! current_user_can( 'manage_options' ) )
15
+if ( ! current_user_can( 'manage_options' ) ) {
16 16
 	wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
17
+}
17 18
 
18 19
 $title = __('General Settings');
19 20
 $parent_file = 'options-general.php';
@@ -68,13 +69,19 @@  discard block
 block discarded – undo
68 69
 <?php if ( !is_multisite() ) { ?>
69 70
 <tr>
70 71
 <th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
71
-<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
72
+<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) {
73
+	echo ' disabled' ?>" /></td>
72 74
 </tr>
73 75
 <tr>
74 76
 <th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
75
-<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
77
+<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' );
78
+}
79
+?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) {
80
+	echo ' disabled' ?>" />
76 81
 <?php if ( ! defined( 'WP_HOME' ) ) : ?>
77
-<p class="description" id="home-description"><?php _e( 'Enter the address here if you <a href="https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">want your site home page to be different from your WordPress installation directory.</a>' ); ?></p></td>
82
+<p class="description" id="home-description"><?php _e( 'Enter the address here if you <a href="https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">want your site home page to be different from your WordPress installation directory.</a>' );
83
+}
84
+?></p></td>
78 85
 <?php endif; ?>
79 86
 </tr>
80 87
 <tr>
@@ -129,18 +136,20 @@  discard block
 block discarded – undo
129 136
 $check_zone_info = true;
130 137
 
131 138
 // Remove old Etc mappings. Fallback to gmt_offset.
132
-if ( false !== strpos($tzstring,'Etc/GMT') )
139
+if ( false !== strpos($tzstring,'Etc/GMT') ) {
133 140
 	$tzstring = '';
141
+}
134 142
 
135 143
 if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
136 144
 	$check_zone_info = false;
137
-	if ( 0 == $current_offset )
138
-		$tzstring = 'UTC+0';
139
-	elseif ($current_offset < 0)
140
-		$tzstring = 'UTC' . $current_offset;
141
-	else
142
-		$tzstring = 'UTC+' . $current_offset;
143
-}
145
+	if ( 0 == $current_offset ) {
146
+			$tzstring = 'UTC+0';
147
+	} elseif ($current_offset < 0) {
148
+			$tzstring = 'UTC' . $current_offset;
149
+	} else {
150
+			$tzstring = 'UTC+' . $current_offset;
151
+	}
152
+	}
144 153
 
145 154
 ?>
146 155
 <th scope="row"><label for="timezone_string"><?php _e('Timezone') ?></label></th>
@@ -177,10 +186,11 @@  discard block
 block discarded – undo
177 186
 	// Set TZ so localtime works.
178 187
 	date_default_timezone_set($tzstring);
179 188
 	$now = localtime(time(), true);
180
-	if ( $now['tm_isdst'] )
181
-		_e('This timezone is currently in daylight saving time.');
182
-	else
183
-		_e('This timezone is currently in standard time.');
189
+	if ( $now['tm_isdst'] ) {
190
+			_e('This timezone is currently in daylight saving time.');
191
+	} else {
192
+			_e('This timezone is currently in standard time.');
193
+	}
184 194
 	?>
185 195
 	<br />
186 196
 	<?php
Please login to merge, or discard this patch.
src/wp-admin/maint/repair.php 2 patches
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -130,18 +130,20 @@
 block discarded – undo
130 130
 	if ( $problems ) {
131 131
 		printf( '<p>' . __('Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.') . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) );
132 132
 		$problem_output = '';
133
-		foreach ( $problems as $table => $problem )
134
-			$problem_output .= "$table: $problem\n";
133
+		foreach ( $problems as $table => $problem ) {
134
+					$problem_output .= "$table: $problem\n";
135
+		}
135 136
 		echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
136 137
 	} else {
137 138
 		echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
138 139
 	}
139 140
 } else {
140
-	if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] )
141
-		echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';
142
-	else
143
-		echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
144
-?>
141
+	if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) {
142
+			echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';
143
+	} else {
144
+			echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
145
+	}
146
+	?>
145 147
 	<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
146 148
 	<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
147 149
 	<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
  */
8 8
 define('WP_REPAIRING', true);
9 9
 
10
-require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/wp-load.php' );
10
+require_once(dirname(dirname(dirname(__FILE__))).'/wp-load.php');
11 11
 
12
-header( 'Content-Type: text/html; charset=utf-8' );
12
+header('Content-Type: text/html; charset=utf-8');
13 13
 ?>
14 14
 <!DOCTYPE html>
15 15
 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
@@ -17,30 +17,30 @@  discard block
 block discarded – undo
17 17
 	<meta name="viewport" content="width=device-width" />
18 18
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19 19
 	<meta name="robots" content="noindex,nofollow" />
20
-	<title><?php _e( 'WordPress &rsaquo; Database Repair' ); ?></title>
20
+	<title><?php _e('WordPress &rsaquo; Database Repair'); ?></title>
21 21
 	<?php
22
-	wp_admin_css( 'install', true );
22
+	wp_admin_css('install', true);
23 23
 	?>
24 24
 </head>
25 25
 <body class="wp-core-ui">
26
-<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
26
+<p id="logo"><a href="<?php echo esc_url(__('https://wordpress.org/')); ?>" tabindex="-1"><?php _e('WordPress'); ?></a></p>
27 27
 
28 28
 <?php
29 29
 
30
-if ( ! defined( 'WP_ALLOW_REPAIR' ) ) {
30
+if ( ! defined('WP_ALLOW_REPAIR')) {
31 31
 
32
-	echo '<h1 class="screen-reader-text">' . __( 'Allow automatic database repair' ) . '</h1>';
32
+	echo '<h1 class="screen-reader-text">'.__('Allow automatic database repair').'</h1>';
33 33
 
34
-	echo '<p>' . __( 'To allow use of this page to automatically repair database problems, please add the following line to your <code>wp-config.php</code> file. Once this line is added to your config, reload this page.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
34
+	echo '<p>'.__('To allow use of this page to automatically repair database problems, please add the following line to your <code>wp-config.php</code> file. Once this line is added to your config, reload this page.')."</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
35 35
 
36 36
 	$default_key     = 'put your unique phrase here';
37 37
 	$missing_key     = false;
38 38
 	$duplicated_keys = array();
39 39
 
40
-	foreach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) {
41
-		if ( defined( $key ) ) {
40
+	foreach (array('AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT') as $key) {
41
+		if (defined($key)) {
42 42
 			// Check for unique values of each key.
43
-			$duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] );
43
+			$duplicated_keys[constant($key)] = isset($duplicated_keys[constant($key)]);
44 44
 		} else {
45 45
 			// If a constant is not defined, it's missing.
46 46
 			$missing_key = true;
@@ -48,24 +48,24 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	// If at least one key uses the default value, consider it duplicated.
51
-	if ( isset( $duplicated_keys[ $default_key ] ) ) {
52
-		$duplicated_keys[ $default_key ] = true;
51
+	if (isset($duplicated_keys[$default_key])) {
52
+		$duplicated_keys[$default_key] = true;
53 53
 	}
54 54
 
55 55
 	// Weed out all unique, non-default values.
56
-	$duplicated_keys = array_filter( $duplicated_keys );
56
+	$duplicated_keys = array_filter($duplicated_keys);
57 57
 
58
-	if ( $duplicated_keys || $missing_key ) {
58
+	if ($duplicated_keys || $missing_key) {
59 59
 
60
-		echo '<h2 class="screen-reader-text">' . __( 'Check secret keys' ) . '</h2>';
60
+		echo '<h2 class="screen-reader-text">'.__('Check secret keys').'</h2>';
61 61
 
62 62
 		// Translators: 1: wp-config.php; 2: Secret key service URL.
63
-		echo '<p>' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href="%2$s">WordPress.org secret key service</a>.' ), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>';
63
+		echo '<p>'.sprintf(__('While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href="%2$s">WordPress.org secret key service</a>.'), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/').'</p>';
64 64
 	}
65 65
 
66
-} elseif ( isset( $_GET['repair'] ) ) {
66
+} elseif (isset($_GET['repair'])) {
67 67
 
68
-	echo '<h1 class="screen-reader-text">' . __( 'Database repair results' ) . '</h1>';
68
+	echo '<h1 class="screen-reader-text">'.__('Database repair results').'</h1>';
69 69
 
70 70
 	$optimize = 2 == $_GET['repair'];
71 71
 	$okay = true;
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	$tables = $wpdb->tables();
75 75
 
76 76
 	// Sitecategories may not exist if global terms are disabled.
77
-	$query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->sitecategories ) );
78
-	if ( is_multisite() && ! $wpdb->get_var( $query ) ) {
79
-		unset( $tables['sitecategories'] );
77
+	$query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->sitecategories));
78
+	if (is_multisite() && ! $wpdb->get_var($query)) {
79
+		unset($tables['sitecategories']);
80 80
 	}
81 81
 
82 82
 	/**
@@ -86,78 +86,78 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @param array $tables Array of prefixed table names to be repaired.
88 88
 	 */
89
-	$tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) );
89
+	$tables = array_merge($tables, (array) apply_filters('tables_to_repair', array()));
90 90
 
91 91
 	// Loop over the tables, checking and repairing as needed.
92
-	foreach ( $tables as $table ) {
93
-		$check = $wpdb->get_row( "CHECK TABLE $table" );
92
+	foreach ($tables as $table) {
93
+		$check = $wpdb->get_row("CHECK TABLE $table");
94 94
 
95 95
 		echo '<p>';
96
-		if ( 'OK' == $check->Msg_text ) {
96
+		if ('OK' == $check->Msg_text) {
97 97
 			/* translators: %s: table name */
98
-			printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
98
+			printf(__('The %s table is okay.'), "<code>$table</code>");
99 99
 		} else {
100 100
 			/* translators: 1: table name, 2: error message, */
101
-			printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ) , "<code>$table</code>", "<code>$check->Msg_text</code>" );
101
+			printf(__('The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;'), "<code>$table</code>", "<code>$check->Msg_text</code>");
102 102
 
103
-			$repair = $wpdb->get_row( "REPAIR TABLE $table" );
103
+			$repair = $wpdb->get_row("REPAIR TABLE $table");
104 104
 
105 105
 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
106
-			if ( 'OK' == $check->Msg_text ) {
106
+			if ('OK' == $check->Msg_text) {
107 107
 				/* translators: %s: table name */
108
-				printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
108
+				printf(__('Successfully repaired the %s table.'), "<code>$table</code>");
109 109
 			} else {
110 110
 				/* translators: 1: table name, 2: error message, */
111
-				echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
111
+				echo sprintf(__('Failed to repair the %1$s table. Error: %2$s'), "<code>$table</code>", "<code>$check->Msg_text</code>").'<br />';
112 112
 				$problems[$table] = $check->Msg_text;
113 113
 				$okay = false;
114 114
 			}
115 115
 		}
116 116
 
117
-		if ( $okay && $optimize ) {
118
-			$check = $wpdb->get_row( "ANALYZE TABLE $table" );
117
+		if ($okay && $optimize) {
118
+			$check = $wpdb->get_row("ANALYZE TABLE $table");
119 119
 
120 120
 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
121
-			if ( 'Table is already up to date' == $check->Msg_text )  {
121
+			if ('Table is already up to date' == $check->Msg_text) {
122 122
 				/* translators: %s: table name */
123
-				printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
123
+				printf(__('The %s table is already optimized.'), "<code>$table</code>");
124 124
 			} else {
125
-				$check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
125
+				$check = $wpdb->get_row("OPTIMIZE TABLE $table");
126 126
 
127 127
 				echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
128
-				if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) {
128
+				if ('OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text) {
129 129
 					/* translators: %s: table name */
130
-					printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
130
+					printf(__('Successfully optimized the %s table.'), "<code>$table</code>");
131 131
 				} else {
132 132
 					/* translators: 1: table name, 2: error message, */
133
-					printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
133
+					printf(__('Failed to optimize the %1$s table. Error: %2$s'), "<code>$table</code>", "<code>$check->Msg_text</code>");
134 134
 				}
135 135
 			}
136 136
 		}
137 137
 		echo '</p>';
138 138
 	}
139 139
 
140
-	if ( $problems ) {
141
-		printf( '<p>' . __('Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.') . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) );
140
+	if ($problems) {
141
+		printf('<p>'.__('Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.').'</p>', __('https://wordpress.org/support/forum/how-to-and-troubleshooting'));
142 142
 		$problem_output = '';
143
-		foreach ( $problems as $table => $problem )
143
+		foreach ($problems as $table => $problem)
144 144
 			$problem_output .= "$table: $problem\n";
145
-		echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
145
+		echo '<p><textarea name="errors" id="errors" rows="20" cols="60">'.esc_textarea($problem_output).'</textarea></p>';
146 146
 	} else {
147
-		echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
147
+		echo '<p>'.__('Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.')."</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
148 148
 	}
149 149
 } else {
150 150
 
151
-	echo '<h1 class="screen-reader-text">' . __( 'WordPress database repair' ) . '</h1>';
151
+	echo '<h1 class="screen-reader-text">'.__('WordPress database repair').'</h1>';
152 152
 
153
-	if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] )
154
-		echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';
153
+	if (isset($_GET['referrer']) && 'is_blog_installed' == $_GET['referrer'])
154
+		echo '<p>'.__('One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.').'</p>';
155 155
 	else
156
-		echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
156
+		echo '<p>'.__('WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.').'</p>';
157 157
 ?>
158
-	<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
159
-	<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
160
-	<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
158
+	<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e('Repair Database'); ?></a></p>
159
+	<p><?php _e('WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.'); ?></p>
160
+	<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e('Repair and Optimize Database'); ?></a></p>
161 161
 <?php
162 162
 }
163 163
 ?>
Please login to merge, or discard this patch.
src/wp-admin/comment.php 2 patches
Braces   +41 added lines, -31 removed lines patch added patch discarded remove patch
@@ -18,20 +18,23 @@  discard block
 block discarded – undo
18 18
 global $action;
19 19
 wp_reset_vars( array('action') );
20 20
 
21
-if ( isset( $_POST['deletecomment'] ) )
21
+if ( isset( $_POST['deletecomment'] ) ) {
22 22
 	$action = 'deletecomment';
23
+}
23 24
 
24
-if ( 'cdc' == $action )
25
+if ( 'cdc' == $action ) {
25 26
 	$action = 'delete';
26
-elseif ( 'mac' == $action )
27
+} elseif ( 'mac' == $action ) {
27 28
 	$action = 'approve';
29
+}
28 30
 
29 31
 if ( isset( $_GET['dt'] ) ) {
30
-	if ( 'spam' == $_GET['dt'] )
31
-		$action = 'spam';
32
-	elseif ( 'trash' == $_GET['dt'] )
33
-		$action = 'trash';
34
-}
32
+	if ( 'spam' == $_GET['dt'] ) {
33
+			$action = 'spam';
34
+	} elseif ( 'trash' == $_GET['dt'] ) {
35
+			$action = 'trash';
36
+	}
37
+	}
35 38
 
36 39
 /**
37 40
  * Display error message at bottom of comments.
@@ -68,14 +71,17 @@  discard block
 block discarded – undo
68 71
 
69 72
 	$comment_id = absint( $_GET['c'] );
70 73
 
71
-	if ( !$comment = get_comment( $comment_id ) )
72
-		comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') );
74
+	if ( !$comment = get_comment( $comment_id ) ) {
75
+			comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') );
76
+	}
73 77
 
74
-	if ( !current_user_can( 'edit_comment', $comment_id ) )
75
-		comment_footer_die( __('You are not allowed to edit this comment.') );
78
+	if ( !current_user_can( 'edit_comment', $comment_id ) ) {
79
+			comment_footer_die( __('You are not allowed to edit this comment.') );
80
+	}
76 81
 
77
-	if ( 'trash' == $comment->comment_approved )
78
-		comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
82
+	if ( 'trash' == $comment->comment_approved ) {
83
+			comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
84
+	}
79 85
 
80 86
 	$comment = get_comment_to_edit( $comment_id );
81 87
 
@@ -244,26 +250,30 @@  discard block
 block discarded – undo
244 250
 case 'unapprovecomment' :
245 251
 	$comment_id = absint( $_REQUEST['c'] );
246 252
 
247
-	if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
248
-		check_admin_referer( 'approve-comment_' . $comment_id );
249
-	else
250
-		check_admin_referer( 'delete-comment_' . $comment_id );
253
+	if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
254
+			check_admin_referer( 'approve-comment_' . $comment_id );
255
+	} else {
256
+			check_admin_referer( 'delete-comment_' . $comment_id );
257
+	}
251 258
 
252 259
 	$noredir = isset($_REQUEST['noredir']);
253 260
 
254
-	if ( !$comment = get_comment($comment_id) )
255
-		comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
256
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
257
-		comment_footer_die( __('You are not allowed to edit comments on this post.') );
258
-
259
-	if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
260
-		$redir = wp_get_referer();
261
-	elseif ( '' != wp_get_original_referer() && ! $noredir )
262
-		$redir = wp_get_original_referer();
263
-	elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
264
-		$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
265
-	else
266
-		$redir = admin_url('edit-comments.php');
261
+	if ( !$comment = get_comment($comment_id) ) {
262
+			comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
263
+	}
264
+	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
265
+			comment_footer_die( __('You are not allowed to edit comments on this post.') );
266
+	}
267
+
268
+	if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') ) {
269
+			$redir = wp_get_referer();
270
+	} elseif ( '' != wp_get_original_referer() && ! $noredir ) {
271
+			$redir = wp_get_original_referer();
272
+	} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
273
+			$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
274
+	} else {
275
+			$redir = admin_url('edit-comments.php');
276
+	}
267 277
 
268 278
 	$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir );
269 279
 
Please login to merge, or discard this patch.
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** Load WordPress Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12 12
 $parent_file = 'edit-comments.php';
13 13
 $submenu_file = 'edit-comments.php';
@@ -16,59 +16,59 @@  discard block
 block discarded – undo
16 16
  * @global string $action
17 17
  */
18 18
 global $action;
19
-wp_reset_vars( array('action') );
19
+wp_reset_vars(array('action'));
20 20
 
21
-if ( isset( $_POST['deletecomment'] ) )
21
+if (isset($_POST['deletecomment']))
22 22
 	$action = 'deletecomment';
23 23
 
24
-if ( 'cdc' == $action )
24
+if ('cdc' == $action)
25 25
 	$action = 'delete';
26
-elseif ( 'mac' == $action )
26
+elseif ('mac' == $action)
27 27
 	$action = 'approve';
28 28
 
29
-if ( isset( $_GET['dt'] ) ) {
30
-	if ( 'spam' == $_GET['dt'] )
29
+if (isset($_GET['dt'])) {
30
+	if ('spam' == $_GET['dt'])
31 31
 		$action = 'spam';
32
-	elseif ( 'trash' == $_GET['dt'] )
32
+	elseif ('trash' == $_GET['dt'])
33 33
 		$action = 'trash';
34 34
 }
35 35
 
36
-switch( $action ) {
36
+switch ($action) {
37 37
 
38 38
 case 'editcomment' :
39 39
 	$title = __('Edit Comment');
40 40
 
41
-	get_current_screen()->add_help_tab( array(
41
+	get_current_screen()->add_help_tab(array(
42 42
 		'id'      => 'overview',
43 43
 		'title'   => __('Overview'),
44 44
 		'content' =>
45
-			'<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .
46
-			'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>'
47
-	) );
45
+			'<p>'.__('You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.').'</p>'.
46
+			'<p>'.__('You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.').'</p>'
47
+	));
48 48
 
49 49
 	get_current_screen()->set_help_sidebar(
50
-	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
51
-	'<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
52
-	'<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
50
+	'<p><strong>'.__('For more information:').'</strong></p>'.
51
+	'<p>'.__('<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>').'</p>'.
52
+	'<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>'
53 53
 	);
54 54
 
55 55
 	wp_enqueue_script('comment');
56
-	require_once( ABSPATH . 'wp-admin/admin-header.php' );
56
+	require_once(ABSPATH.'wp-admin/admin-header.php');
57 57
 
58
-	$comment_id = absint( $_GET['c'] );
58
+	$comment_id = absint($_GET['c']);
59 59
 
60
-	if ( !$comment = get_comment( $comment_id ) )
61
-		comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') );
60
+	if ( ! $comment = get_comment($comment_id))
61
+		comment_footer_die(__('Invalid comment ID.').sprintf(' <a href="%s">'.__('Go back').'</a>.', 'javascript:history.go(-1)'));
62 62
 
63
-	if ( !current_user_can( 'edit_comment', $comment_id ) )
64
-		comment_footer_die( __('You are not allowed to edit this comment.') );
63
+	if ( ! current_user_can('edit_comment', $comment_id))
64
+		comment_footer_die(__('You are not allowed to edit this comment.'));
65 65
 
66
-	if ( 'trash' == $comment->comment_approved )
67
-		comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
66
+	if ('trash' == $comment->comment_approved)
67
+		comment_footer_die(__('This comment is in the Trash. Please move it out of the Trash if you want to edit it.'));
68 68
 
69
-	$comment = get_comment_to_edit( $comment_id );
69
+	$comment = get_comment_to_edit($comment_id);
70 70
 
71
-	include( ABSPATH . 'wp-admin/edit-form-comment.php' );
71
+	include(ABSPATH.'wp-admin/edit-form-comment.php');
72 72
 
73 73
 	break;
74 74
 
@@ -79,40 +79,40 @@  discard block
 block discarded – undo
79 79
 
80 80
 	$title = __('Moderate Comment');
81 81
 
82
-	$comment_id = absint( $_GET['c'] );
82
+	$comment_id = absint($_GET['c']);
83 83
 
84
-	if ( ! $comment = get_comment( $comment_id ) ) {
85
-		wp_redirect( admin_url('edit-comments.php?error=1') );
84
+	if ( ! $comment = get_comment($comment_id)) {
85
+		wp_redirect(admin_url('edit-comments.php?error=1'));
86 86
 		die();
87 87
 	}
88 88
 
89
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
90
-		wp_redirect( admin_url('edit-comments.php?error=2') );
89
+	if ( ! current_user_can('edit_comment', $comment->comment_ID)) {
90
+		wp_redirect(admin_url('edit-comments.php?error=2'));
91 91
 		die();
92 92
 	}
93 93
 
94 94
 	// No need to re-approve/re-trash/re-spam a comment.
95
-	if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) {
96
-		wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
95
+	if ($action == str_replace('1', 'approve', $comment->comment_approved)) {
96
+		wp_redirect(admin_url('edit-comments.php?same='.$comment_id));
97 97
 		die();
98 98
  	}
99 99
 
100
-	require_once( ABSPATH . 'wp-admin/admin-header.php' );
100
+	require_once(ABSPATH.'wp-admin/admin-header.php');
101 101
 
102
-	$formaction    = $action . 'comment';
102
+	$formaction    = $action.'comment';
103 103
 	$nonce_action  = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
104 104
 	$nonce_action .= $comment_id;
105 105
 
106 106
 ?>
107 107
 <div class="wrap">
108 108
 
109
-<h1><?php echo esc_html( $title ); ?></h1>
109
+<h1><?php echo esc_html($title); ?></h1>
110 110
 
111 111
 <?php
112
-switch ( $action ) {
112
+switch ($action) {
113 113
 	case 'spam' :
114 114
 		$caution_msg = __('You are about to mark the following comment as spam:');
115
-		$button      = _x( 'Mark as Spam', 'comment' );
115
+		$button      = _x('Mark as Spam', 'comment');
116 116
 		break;
117 117
 	case 'trash' :
118 118
 		$caution_msg = __('You are about to move the following comment to the Trash:');
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 		break;
129 129
 }
130 130
 
131
-if ( $comment->comment_approved != '0' ) { // if not unapproved
131
+if ($comment->comment_approved != '0') { // if not unapproved
132 132
 	$message = '';
133
-	switch ( $comment->comment_approved ) {
133
+	switch ($comment->comment_approved) {
134 134
 		case '1' :
135 135
 			$message = __('This comment is currently approved.');
136 136
 			break;
@@ -141,68 +141,68 @@  discard block
 block discarded – undo
141 141
 			$message  = __('This comment is currently in the Trash.');
142 142
 			break;
143 143
 	}
144
-	if ( $message ) {
145
-		echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
144
+	if ($message) {
145
+		echo '<div id="message" class="notice notice-info"><p>'.$message.'</p></div>';
146 146
 	}
147 147
 }
148 148
 ?>
149
-<div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
149
+<div id="message" class="notice notice-warning"><p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p></div>
150 150
 
151 151
 <table class="form-table comment-ays">
152 152
 <tr>
153 153
 <th scope="row"><?php _e('Author'); ?></th>
154
-<td><?php comment_author( $comment ); ?></td>
154
+<td><?php comment_author($comment); ?></td>
155 155
 </tr>
156
-<?php if ( get_comment_author_email( $comment ) ) { ?>
156
+<?php if (get_comment_author_email($comment)) { ?>
157 157
 <tr>
158 158
 <th scope="row"><?php _e('Email'); ?></th>
159
-<td><?php comment_author_email( $comment ); ?></td>
159
+<td><?php comment_author_email($comment); ?></td>
160 160
 </tr>
161 161
 <?php } ?>
162
-<?php if ( get_comment_author_url( $comment ) ) { ?>
162
+<?php if (get_comment_author_url($comment)) { ?>
163 163
 <tr>
164 164
 <th scope="row"><?php _e('URL'); ?></th>
165
-<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td>
165
+<td><a href="<?php comment_author_url($comment); ?>"><?php comment_author_url($comment); ?></a></td>
166 166
 </tr>
167 167
 <?php } ?>
168 168
 <tr>
169
-	<th scope="row"><?php /* translators: column name or table row header */ _e( 'In Response To' ); ?></th>
169
+	<th scope="row"><?php /* translators: column name or table row header */ _e('In Response To'); ?></th>
170 170
 	<td>
171 171
 	<?php
172 172
 		$post_id = $comment->comment_post_ID;
173
-		if ( current_user_can( 'edit_post', $post_id ) ) {
174
-			$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
175
-			$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
173
+		if (current_user_can('edit_post', $post_id)) {
174
+			$post_link = "<a href='".esc_url(get_edit_post_link($post_id))."'>";
175
+			$post_link .= esc_html(get_the_title($post_id)).'</a>';
176 176
 		} else {
177
-			$post_link = esc_html( get_the_title( $post_id ) );
177
+			$post_link = esc_html(get_the_title($post_id));
178 178
 		}
179 179
 		echo $post_link;
180 180
 
181
-		if ( $comment->comment_parent ) {
182
-			$parent      = get_comment( $comment->comment_parent );
183
-			$parent_link = esc_url( get_comment_link( $parent ) );
184
-			$name        = get_comment_author( $parent );
181
+		if ($comment->comment_parent) {
182
+			$parent      = get_comment($comment->comment_parent);
183
+			$parent_link = esc_url(get_comment_link($parent));
184
+			$name        = get_comment_author($parent);
185 185
 			printf(
186 186
 				/* translators: %s: comment link */
187
-				' | ' . __( 'In reply to %s.' ),
188
-				'<a href="' . $parent_link . '">' . $name . '</a>'
187
+				' | '.__('In reply to %s.'),
188
+				'<a href="'.$parent_link.'">'.$name.'</a>'
189 189
 			);
190 190
 		}
191 191
 	?>
192 192
 	</td>
193 193
 </tr>
194 194
 <tr>
195
-	<th scope="row"><?php _e( 'Submitted on' ); ?></th>
195
+	<th scope="row"><?php _e('Submitted on'); ?></th>
196 196
 	<td>
197 197
 	<?php
198 198
 		/* translators: 1: comment date, 2: comment time */
199
-		$submitted = sprintf( __( '%1$s at %2$s' ),
199
+		$submitted = sprintf(__('%1$s at %2$s'),
200 200
 			/* translators: comment date format. See http://php.net/date */
201
-			get_comment_date( __( 'Y/m/d' ), $comment ),
202
-			get_comment_date( __( 'g:i a' ), $comment )
201
+			get_comment_date(__('Y/m/d'), $comment),
202
+			get_comment_date(__('g:i a'), $comment)
203 203
 		);
204
-		if ( 'approved' === wp_get_comment_status( $comment ) && ! empty ( $comment->comment_post_ID ) ) {
205
-			echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
204
+		if ('approved' === wp_get_comment_status($comment) && ! empty ($comment->comment_post_ID)) {
205
+			echo '<a href="'.esc_url(get_comment_link($comment)).'">'.$submitted.'</a>';
206 206
 		} else {
207 207
 			echo $submitted;
208 208
 		}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 <th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
214 214
 <td>
215 215
 	<?php echo $comment->comment_content; ?>
216
-	<p><a href="<?php echo admin_url( "comment.php?action=editcomment&amp;c={$comment->comment_ID}" ); ?>"><?php esc_attr_e( 'Edit' ); ?></a></p>
216
+	<p><a href="<?php echo admin_url("comment.php?action=editcomment&amp;c={$comment->comment_ID}"); ?>"><?php esc_attr_e('Edit'); ?></a></p>
217 217
 </td>
218 218
 </tr>
219 219
 </table>
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 <form action="comment.php" method="get" class="comment-ays-submit">
222 222
 
223 223
 <p>
224
-	<?php submit_button( $button, 'primary', 'submit', false ); ?>
225
-	<a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a>
224
+	<?php submit_button($button, 'primary', 'submit', false); ?>
225
+	<a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e('Cancel'); ?></a>
226 226
 </p>
227 227
 
228
-<?php wp_nonce_field( $nonce_action ); ?>
228
+<?php wp_nonce_field($nonce_action); ?>
229 229
 <input type="hidden" name="action" value="<?php echo esc_attr($formaction); ?>" />
230 230
 <input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID); ?>" />
231 231
 <input type="hidden" name="noredir" value="1" />
@@ -242,75 +242,75 @@  discard block
 block discarded – undo
242 242
 case 'unspamcomment'    :
243 243
 case 'approvecomment'   :
244 244
 case 'unapprovecomment' :
245
-	$comment_id = absint( $_REQUEST['c'] );
245
+	$comment_id = absint($_REQUEST['c']);
246 246
 
247
-	if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
248
-		check_admin_referer( 'approve-comment_' . $comment_id );
247
+	if (in_array($action, array('approvecomment', 'unapprovecomment')))
248
+		check_admin_referer('approve-comment_'.$comment_id);
249 249
 	else
250
-		check_admin_referer( 'delete-comment_' . $comment_id );
250
+		check_admin_referer('delete-comment_'.$comment_id);
251 251
 
252 252
 	$noredir = isset($_REQUEST['noredir']);
253 253
 
254
-	if ( !$comment = get_comment($comment_id) )
255
-		comment_footer_die( __( 'Invalid comment ID.' ) . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
256
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
257
-		comment_footer_die( __('You are not allowed to edit comments on this post.') );
254
+	if ( ! $comment = get_comment($comment_id))
255
+		comment_footer_die(__('Invalid comment ID.').sprintf(' <a href="%s">'.__('Go back').'</a>.', 'edit-comments.php'));
256
+	if ( ! current_user_can('edit_comment', $comment->comment_ID))
257
+		comment_footer_die(__('You are not allowed to edit comments on this post.'));
258 258
 
259
-	if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
259
+	if ('' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php'))
260 260
 		$redir = wp_get_referer();
261
-	elseif ( '' != wp_get_original_referer() && ! $noredir )
261
+	elseif ('' != wp_get_original_referer() && ! $noredir)
262 262
 		$redir = wp_get_original_referer();
263
-	elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
264
-		$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
263
+	elseif (in_array($action, array('approvecomment', 'unapprovecomment')))
264
+		$redir = admin_url('edit-comments.php?p='.absint($comment->comment_post_ID));
265 265
 	else
266 266
 		$redir = admin_url('edit-comments.php');
267 267
 
268
-	$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir );
268
+	$redir = remove_query_arg(array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir);
269 269
 
270
-	switch ( $action ) {
270
+	switch ($action) {
271 271
 		case 'deletecomment' :
272
-			wp_delete_comment( $comment );
273
-			$redir = add_query_arg( array('deleted' => '1'), $redir );
272
+			wp_delete_comment($comment);
273
+			$redir = add_query_arg(array('deleted' => '1'), $redir);
274 274
 			break;
275 275
 		case 'trashcomment' :
276
-			wp_trash_comment( $comment );
277
-			$redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
276
+			wp_trash_comment($comment);
277
+			$redir = add_query_arg(array('trashed' => '1', 'ids' => $comment_id), $redir);
278 278
 			break;
279 279
 		case 'untrashcomment' :
280
-			wp_untrash_comment( $comment );
281
-			$redir = add_query_arg( array('untrashed' => '1'), $redir );
280
+			wp_untrash_comment($comment);
281
+			$redir = add_query_arg(array('untrashed' => '1'), $redir);
282 282
 			break;
283 283
 		case 'spamcomment' :
284
-			wp_spam_comment( $comment );
285
-			$redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
284
+			wp_spam_comment($comment);
285
+			$redir = add_query_arg(array('spammed' => '1', 'ids' => $comment_id), $redir);
286 286
 			break;
287 287
 		case 'unspamcomment' :
288
-			wp_unspam_comment( $comment );
289
-			$redir = add_query_arg( array('unspammed' => '1'), $redir );
288
+			wp_unspam_comment($comment);
289
+			$redir = add_query_arg(array('unspammed' => '1'), $redir);
290 290
 			break;
291 291
 		case 'approvecomment' :
292
-			wp_set_comment_status( $comment, 'approve' );
293
-			$redir = add_query_arg( array( 'approved' => 1 ), $redir );
292
+			wp_set_comment_status($comment, 'approve');
293
+			$redir = add_query_arg(array('approved' => 1), $redir);
294 294
 			break;
295 295
 		case 'unapprovecomment' :
296
-			wp_set_comment_status( $comment, 'hold' );
297
-			$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
296
+			wp_set_comment_status($comment, 'hold');
297
+			$redir = add_query_arg(array('unapproved' => 1), $redir);
298 298
 			break;
299 299
 	}
300 300
 
301
-	wp_redirect( $redir );
301
+	wp_redirect($redir);
302 302
 	die;
303 303
 
304 304
 case 'editedcomment' :
305 305
 
306
-	$comment_id = absint( $_POST['comment_ID'] );
307
-	$comment_post_id = absint( $_POST['comment_post_ID'] );
306
+	$comment_id = absint($_POST['comment_ID']);
307
+	$comment_post_id = absint($_POST['comment_post_ID']);
308 308
 
309
-	check_admin_referer( 'update-comment_' . $comment_id );
309
+	check_admin_referer('update-comment_'.$comment_id);
310 310
 
311 311
 	edit_comment();
312 312
 
313
-	$location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
313
+	$location = (empty($_POST['referredby']) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby']).'#comment-'.$comment_id;
314 314
 
315 315
 	/**
316 316
 	 * Filter the URI the user is redirected to after editing a comment in the admin.
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
 	 * @param string $location The URI the user will be redirected to.
321 321
 	 * @param int $comment_id The ID of the comment being edited.
322 322
 	 */
323
-	$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
324
-	wp_redirect( $location );
323
+	$location = apply_filters('comment_edit_redirect', $location, $comment_id);
324
+	wp_redirect($location);
325 325
 
326 326
 	exit();
327 327
 
328 328
 default:
329
-	wp_die( __('Unknown action.') );
329
+	wp_die(__('Unknown action.'));
330 330
 
331 331
 } // end switch
332 332
 
333
-include( ABSPATH . 'wp-admin/admin-footer.php' );
333
+include(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.