Completed
Push — master ( d99bf9...491baf )
by Stephen
13:47
created
src/wp-includes/widgets/class-wp-widget-calendar.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 	public function __construct() {
36 36
 		$widget_ops = array(
37 37
 			'classname' => 'widget_calendar',
38
-			'description' => __( 'A calendar of your site’s Posts.' ),
38
+			'description' => __('A calendar of your site’s Posts.'),
39 39
 			'customize_selective_refresh' => true,
40 40
 		);
41
-		parent::__construct( 'calendar', __( 'Calendar' ), $widget_ops );
41
+		parent::__construct('calendar', __('Calendar'), $widget_ops);
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
 	 *                        'before_widget', and 'after_widget'.
52 52
 	 * @param array $instance The settings for the particular instance of the widget.
53 53
 	 */
54
-	public function widget( $args, $instance ) {
54
+	public function widget($args, $instance) {
55 55
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
56
-		$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
56
+		$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
57 57
 
58 58
 		echo $args['before_widget'];
59
-		if ( $title ) {
60
-			echo $args['before_title'] . $title . $args['after_title'];
59
+		if ($title) {
60
+			echo $args['before_title'].$title.$args['after_title'];
61 61
 		}
62
-		if ( 0 === self::$instance ) {
62
+		if (0 === self::$instance) {
63 63
 			echo '<div id="calendar_wrap" class="calendar_wrap">';
64 64
 		} else {
65 65
 			echo '<div class="calendar_wrap">';
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 * @param array $old_instance Old settings for this instance.
83 83
 	 * @return array Updated settings to save.
84 84
 	 */
85
-	public function update( $new_instance, $old_instance ) {
85
+	public function update($new_instance, $old_instance) {
86 86
 		$instance = $old_instance;
87
-		$instance['title'] = sanitize_text_field( $new_instance['title'] );
87
+		$instance['title'] = sanitize_text_field($new_instance['title']);
88 88
 
89 89
 		return $instance;
90 90
 	}
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 	 *
98 98
 	 * @param array $instance Current settings.
99 99
 	 */
100
-	public function form( $instance ) {
101
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
102
-		$title = sanitize_text_field( $instance['title'] );
100
+	public function form($instance) {
101
+		$instance = wp_parse_args((array) $instance, array('title' => ''));
102
+		$title = sanitize_text_field($instance['title']);
103 103
 		?>
104 104
 		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
105 105
 		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
Please login to merge, or discard this patch.
src/wp-includes/widgets/class-wp-widget-search.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	public function __construct() {
26 26
 		$widget_ops = array(
27 27
 			'classname' => 'widget_search',
28
-			'description' => __( 'A search form for your site.' ),
28
+			'description' => __('A search form for your site.'),
29 29
 			'customize_selective_refresh' => true,
30 30
 		);
31
-		parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops );
31
+		parent::__construct('search', _x('Search', 'Search widget'), $widget_ops);
32 32
 	}
33 33
 
34 34
 	/**
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 	 *                        'before_widget', and 'after_widget'.
42 42
 	 * @param array $instance Settings for the current Search widget instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
46
-		$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
46
+		$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
47 47
 
48 48
 		echo $args['before_widget'];
49
-		if ( $title ) {
50
-			echo $args['before_title'] . $title . $args['after_title'];
49
+		if ($title) {
50
+			echo $args['before_title'].$title.$args['after_title'];
51 51
 		}
52 52
 
53 53
 		// Use current theme search form if it exists
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @param array $instance Current settings.
66 66
 	 */
67
-	public function form( $instance ) {
68
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
67
+	public function form($instance) {
68
+		$instance = wp_parse_args((array) $instance, array('title' => ''));
69 69
 		$title = $instance['title'];
70 70
 		?>
71 71
 		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	 * @param array $old_instance Old settings for this instance.
84 84
 	 * @return array Updated settings.
85 85
 	 */
86
-	public function update( $new_instance, $old_instance ) {
86
+	public function update($new_instance, $old_instance) {
87 87
 		$instance = $old_instance;
88
-		$new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
89
-		$instance['title'] = sanitize_text_field( $new_instance['title'] );
88
+		$new_instance = wp_parse_args((array) $new_instance, array('title' => ''));
89
+		$instance['title'] = sanitize_text_field($new_instance['title']);
90 90
 		return $instance;
91 91
 	}
92 92
 
Please login to merge, or discard this patch.
src/wp-includes/widgets/class-wp-widget-categories.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	public function __construct() {
26 26
 		$widget_ops = array(
27 27
 			'classname' => 'widget_categories',
28
-			'description' => __( 'A list or dropdown of categories.' ),
28
+			'description' => __('A list or dropdown of categories.'),
29 29
 			'customize_selective_refresh' => true,
30 30
 		);
31
-		parent::__construct( 'categories', __( 'Categories' ), $widget_ops );
31
+		parent::__construct('categories', __('Categories'), $widget_ops);
32 32
 	}
33 33
 
34 34
 	/**
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 	 *                        'before_widget', and 'after_widget'.
42 42
 	 * @param array $instance Settings for the current Categories widget instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 		static $first_dropdown = true;
46 46
 
47 47
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
48
-		$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base );
48
+		$title = apply_filters('widget_title', empty($instance['title']) ? __('Categories') : $instance['title'], $instance, $this->id_base);
49 49
 
50
-		$c = ! empty( $instance['count'] ) ? '1' : '0';
51
-		$h = ! empty( $instance['hierarchical'] ) ? '1' : '0';
52
-		$d = ! empty( $instance['dropdown'] ) ? '1' : '0';
50
+		$c = ! empty($instance['count']) ? '1' : '0';
51
+		$h = ! empty($instance['hierarchical']) ? '1' : '0';
52
+		$d = ! empty($instance['dropdown']) ? '1' : '0';
53 53
 
54 54
 		echo $args['before_widget'];
55
-		if ( $title ) {
56
-			echo $args['before_title'] . $title . $args['after_title'];
55
+		if ($title) {
56
+			echo $args['before_title'].$title.$args['after_title'];
57 57
 		}
58 58
 
59 59
 		$cat_args = array(
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 			'hierarchical' => $h
63 63
 		);
64 64
 
65
-		if ( $d ) {
66
-			$dropdown_id = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}";
65
+		if ($d) {
66
+			$dropdown_id = ($first_dropdown) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}";
67 67
 			$first_dropdown = false;
68 68
 
69
-			echo '<label class="screen-reader-text" for="' . esc_attr( $dropdown_id ) . '">' . $title . '</label>';
69
+			echo '<label class="screen-reader-text" for="'.esc_attr($dropdown_id).'">'.$title.'</label>';
70 70
 
71
-			$cat_args['show_option_none'] = __( 'Select Category' );
71
+			$cat_args['show_option_none'] = __('Select Category');
72 72
 			$cat_args['id'] = $dropdown_id;
73 73
 
74 74
 			/**
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 			 *
81 81
 			 * @param array $cat_args An array of Categories widget drop-down arguments.
82 82
 			 */
83
-			wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args ) );
83
+			wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
84 84
 			?>
85 85
 
86 86
 <script type='text/javascript'>
87 87
 /* <![CDATA[ */
88 88
 (function() {
89
-	var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" );
89
+	var dropdown = document.getElementById( "<?php echo esc_js($dropdown_id); ?>" );
90 90
 	function onCatChange() {
91 91
 		if ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) {
92 92
 			location.href = "<?php echo home_url(); ?>/?cat=" + dropdown.options[ dropdown.selectedIndex ].value;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		 *
112 112
 		 * @param array $cat_args An array of Categories widget options.
113 113
 		 */
114
-		wp_list_categories( apply_filters( 'widget_categories_args', $cat_args ) );
114
+		wp_list_categories(apply_filters('widget_categories_args', $cat_args));
115 115
 ?>
116 116
 		</ul>
117 117
 <?php
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 	 * @param array $old_instance Old settings for this instance.
132 132
 	 * @return array Updated settings to save.
133 133
 	 */
134
-	public function update( $new_instance, $old_instance ) {
134
+	public function update($new_instance, $old_instance) {
135 135
 		$instance = $old_instance;
136
-		$instance['title'] = sanitize_text_field( $new_instance['title'] );
137
-		$instance['count'] = !empty($new_instance['count']) ? 1 : 0;
138
-		$instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0;
139
-		$instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0;
136
+		$instance['title'] = sanitize_text_field($new_instance['title']);
137
+		$instance['count'] = ! empty($new_instance['count']) ? 1 : 0;
138
+		$instance['hierarchical'] = ! empty($new_instance['hierarchical']) ? 1 : 0;
139
+		$instance['dropdown'] = ! empty($new_instance['dropdown']) ? 1 : 0;
140 140
 
141 141
 		return $instance;
142 142
 	}
@@ -149,25 +149,25 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @param array $instance Current settings.
151 151
 	 */
152
-	public function form( $instance ) {
152
+	public function form($instance) {
153 153
 		//Defaults
154
-		$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
155
-		$title = sanitize_text_field( $instance['title'] );
156
-		$count = isset($instance['count']) ? (bool) $instance['count'] :false;
157
-		$hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;
158
-		$dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;
154
+		$instance = wp_parse_args((array) $instance, array('title' => ''));
155
+		$title = sanitize_text_field($instance['title']);
156
+		$count = isset($instance['count']) ? (bool) $instance['count'] : false;
157
+		$hierarchical = isset($instance['hierarchical']) ? (bool) $instance['hierarchical'] : false;
158
+		$dropdown = isset($instance['dropdown']) ? (bool) $instance['dropdown'] : false;
159 159
 		?>
160
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
161
-		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
160
+		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
161
+		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
162 162
 
163
-		<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />
164
-		<label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
163
+		<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked($dropdown); ?> />
164
+		<label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label><br />
165 165
 
166
-		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> />
167
-		<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br />
166
+		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked($count); ?> />
167
+		<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts'); ?></label><br />
168 168
 
169
-		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> />
170
-		<label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label></p>
169
+		<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked($hierarchical); ?> />
170
+		<label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e('Show hierarchy'); ?></label></p>
171 171
 		<?php
172 172
 	}
173 173
 
Please login to merge, or discard this patch.
src/wp-admin/includes/class-automatic-upgrader-skin.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	/**
51
-	 * @param string|array|WP_Error $data
51
+	 * @param string $data
52 52
 	 */
53 53
 	public function feedback( $data ) {
54 54
 		if ( is_wp_error( $data ) ) {
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,14 +58,16 @@  discard block
 block discarded – undo
58 58
 		} else {
59 59
 			$string = $data;
60 60
 		}
61
-		if ( ! empty( $this->upgrader->strings[ $string ] ) )
62
-			$string = $this->upgrader->strings[ $string ];
61
+		if ( ! empty( $this->upgrader->strings[ $string ] ) ) {
62
+					$string = $this->upgrader->strings[ $string ];
63
+		}
63 64
 
64 65
 		if ( strpos( $string, '%' ) !== false ) {
65 66
 			$args = func_get_args();
66 67
 			$args = array_splice( $args, 1 );
67
-			if ( ! empty( $args ) )
68
-				$string = vsprintf( $string, $args );
68
+			if ( ! empty( $args ) ) {
69
+							$string = vsprintf( $string, $args );
70
+			}
69 71
 		}
70 72
 
71 73
 		$string = trim( $string );
@@ -80,8 +82,9 @@  discard block
 block discarded – undo
80 82
 			'strong' => true,
81 83
 		) );
82 84
 
83
-		if ( empty( $string ) )
84
-			return;
85
+		if ( empty( $string ) ) {
86
+					return;
87
+		}
85 88
 
86 89
 		$this->messages[] = $string;
87 90
 	}
@@ -98,7 +101,8 @@  discard block
 block discarded – undo
98 101
 	 */
99 102
 	public function footer() {
100 103
 		$output = ob_get_clean();
101
-		if ( ! empty( $output ) )
102
-			$this->feedback( $output );
104
+		if ( ! empty( $output ) ) {
105
+					$this->feedback( $output );
106
+		}
103 107
 	}
104 108
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 	 * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
38 38
 	 * @return bool True on success, false on failure.
39 39
 	 */
40
-	public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
41
-		if ( $context ) {
40
+	public function request_filesystem_credentials($error = false, $context = '', $allow_relaxed_file_ownership = false) {
41
+		if ($context) {
42 42
 			$this->options['context'] = $context;
43 43
 		}
44 44
 		// TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version
45 45
 		// This will output a credentials form in event of failure, We don't want that, so just hide with a buffer
46 46
 		ob_start();
47
-		$result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
47
+		$result = parent::request_filesystem_credentials($error, $context, $allow_relaxed_file_ownership);
48 48
 		ob_end_clean();
49 49
 		return $result;
50 50
 	}
@@ -61,37 +61,37 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * @param string|array|WP_Error $data
63 63
 	 */
64
-	public function feedback( $data ) {
65
-		if ( is_wp_error( $data ) ) {
64
+	public function feedback($data) {
65
+		if (is_wp_error($data)) {
66 66
 			$string = $data->get_error_message();
67
-		} elseif ( is_array( $data ) ) {
67
+		} elseif (is_array($data)) {
68 68
 			return;
69 69
 		} else {
70 70
 			$string = $data;
71 71
 		}
72
-		if ( ! empty( $this->upgrader->strings[ $string ] ) )
73
-			$string = $this->upgrader->strings[ $string ];
72
+		if ( ! empty($this->upgrader->strings[$string]))
73
+			$string = $this->upgrader->strings[$string];
74 74
 
75
-		if ( strpos( $string, '%' ) !== false ) {
75
+		if (strpos($string, '%') !== false) {
76 76
 			$args = func_get_args();
77
-			$args = array_splice( $args, 1 );
78
-			if ( ! empty( $args ) )
79
-				$string = vsprintf( $string, $args );
77
+			$args = array_splice($args, 1);
78
+			if ( ! empty($args))
79
+				$string = vsprintf($string, $args);
80 80
 		}
81 81
 
82
-		$string = trim( $string );
82
+		$string = trim($string);
83 83
 
84 84
 		// Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output.
85
-		$string = wp_kses( $string, array(
85
+		$string = wp_kses($string, array(
86 86
 			'a' => array(
87 87
 				'href' => true
88 88
 			),
89 89
 			'br' => true,
90 90
 			'em' => true,
91 91
 			'strong' => true,
92
-		) );
92
+		));
93 93
 
94
-		if ( empty( $string ) )
94
+		if (empty($string))
95 95
 			return;
96 96
 
97 97
 		$this->messages[] = $string;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function footer() {
111 111
 		$output = ob_get_clean();
112
-		if ( ! empty( $output ) )
113
-			$this->feedback( $output );
112
+		if ( ! empty($output))
113
+			$this->feedback($output);
114 114
 	}
115 115
 }
Please login to merge, or discard this patch.
src/wp-admin/includes/class-plugin-upgrader.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@
 block discarded – undo
204 204
 	 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
205 205
 	 * @access public
206 206
 	 *
207
-	 * @param array $plugins Array of the basename paths of the plugins' main files.
207
+	 * @param string[] $plugins Array of the basename paths of the plugins' main files.
208 208
 	 * @param array $args {
209 209
 	 *     Optional. Other arguments for upgrading several plugins at once. Default empty array.
210 210
 	 *
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -431,7 +431,7 @@
 block discarded – undo
431 431
 	 * @access public
432 432
 	 *
433 433
 	 * @global WP_Filesystem_Base $wp_filesystem Subclass
434
-     *
434
+	 *
435 435
 	 * @param bool|WP_Error $removed
436 436
 	 * @param string        $local_destination
437 437
 	 * @param string        $remote_destination
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -90,23 +90,23 @@  discard block
 block discarded – undo
90 90
 	 * }
91 91
 	 * @return bool|WP_Error True if the install was successful, false or a WP_Error otherwise.
92 92
 	 */
93
-	public function install( $package, $args = array() ) {
93
+	public function install($package, $args = array()) {
94 94
 
95 95
 		$defaults = array(
96 96
 			'clear_update_cache' => true,
97 97
 		);
98
-		$parsed_args = wp_parse_args( $args, $defaults );
98
+		$parsed_args = wp_parse_args($args, $defaults);
99 99
 
100 100
 		$this->init();
101 101
 		$this->install_strings();
102 102
 
103
-		add_filter('upgrader_source_selection', array($this, 'check_package') );
104
-		if ( $parsed_args['clear_update_cache'] ) {
103
+		add_filter('upgrader_source_selection', array($this, 'check_package'));
104
+		if ($parsed_args['clear_update_cache']) {
105 105
 			// Clear cache so wp_update_plugins() knows about the new plugin.
106
-			add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
106
+			add_action('upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0);
107 107
 		}
108 108
 
109
-		$this->run( array(
109
+		$this->run(array(
110 110
 			'package' => $package,
111 111
 			'destination' => WP_PLUGIN_DIR,
112 112
 			'clear_destination' => false, // Do not overwrite files.
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 				'type' => 'plugin',
116 116
 				'action' => 'install',
117 117
 			)
118
-		) );
118
+		));
119 119
 
120
-		remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
121
-		remove_filter('upgrader_source_selection', array($this, 'check_package') );
120
+		remove_action('upgrader_process_complete', 'wp_clean_plugins_cache', 9);
121
+		remove_filter('upgrader_source_selection', array($this, 'check_package'));
122 122
 
123
-		if ( ! $this->result || is_wp_error($this->result) )
123
+		if ( ! $this->result || is_wp_error($this->result))
124 124
 			return $this->result;
125 125
 
126 126
 		// Force refresh of plugin update information
127
-		wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
127
+		wp_clean_plugins_cache($parsed_args['clear_update_cache']);
128 128
 
129 129
 		return true;
130 130
 	}
@@ -145,18 +145,18 @@  discard block
 block discarded – undo
145 145
 	 * }
146 146
 	 * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
147 147
 	 */
148
-	public function upgrade( $plugin, $args = array() ) {
148
+	public function upgrade($plugin, $args = array()) {
149 149
 
150 150
 		$defaults = array(
151 151
 			'clear_update_cache' => true,
152 152
 		);
153
-		$parsed_args = wp_parse_args( $args, $defaults );
153
+		$parsed_args = wp_parse_args($args, $defaults);
154 154
 
155 155
 		$this->init();
156 156
 		$this->upgrade_strings();
157 157
 
158
-		$current = get_site_transient( 'update_plugins' );
159
-		if ( !isset( $current->response[ $plugin ] ) ) {
158
+		$current = get_site_transient('update_plugins');
159
+		if ( ! isset($current->response[$plugin])) {
160 160
 			$this->skin->before();
161 161
 			$this->skin->set_result(false);
162 162
 			$this->skin->error('up_to_date');
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
 		}
166 166
 
167 167
 		// Get the URL to the zip file
168
-		$r = $current->response[ $plugin ];
168
+		$r = $current->response[$plugin];
169 169
 
170 170
 		add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
171 171
 		add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
172 172
 		//'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
173
-		if ( $parsed_args['clear_update_cache'] ) {
173
+		if ($parsed_args['clear_update_cache']) {
174 174
 			// Clear cache so wp_update_plugins() knows about the new plugin.
175
-			add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
175
+			add_action('upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0);
176 176
 		}
177 177
 
178
-		$this->run( array(
178
+		$this->run(array(
179 179
 			'package' => $r->package,
180 180
 			'destination' => WP_PLUGIN_DIR,
181 181
 			'clear_destination' => true,
@@ -185,18 +185,18 @@  discard block
 block discarded – undo
185 185
 				'type' => 'plugin',
186 186
 				'action' => 'update',
187 187
 			),
188
-		) );
188
+		));
189 189
 
190 190
 		// Cleanup our hooks, in case something else does a upgrade on this connection.
191
-		remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
191
+		remove_action('upgrader_process_complete', 'wp_clean_plugins_cache', 9);
192 192
 		remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
193 193
 		remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
194 194
 
195
-		if ( ! $this->result || is_wp_error($this->result) )
195
+		if ( ! $this->result || is_wp_error($this->result))
196 196
 			return $this->result;
197 197
 
198 198
 		// Force refresh of plugin update information
199
-		wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
199
+		wp_clean_plugins_cache($parsed_args['clear_update_cache']);
200 200
 
201 201
 		return true;
202 202
 	}
@@ -217,26 +217,26 @@  discard block
 block discarded – undo
217 217
 	 * }
218 218
 	 * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.
219 219
 	 */
220
-	public function bulk_upgrade( $plugins, $args = array() ) {
220
+	public function bulk_upgrade($plugins, $args = array()) {
221 221
 
222 222
 		$defaults = array(
223 223
 			'clear_update_cache' => true,
224 224
 		);
225
-		$parsed_args = wp_parse_args( $args, $defaults );
225
+		$parsed_args = wp_parse_args($args, $defaults);
226 226
 
227 227
 		$this->init();
228 228
 		$this->bulk = true;
229 229
 		$this->upgrade_strings();
230 230
 
231
-		$current = get_site_transient( 'update_plugins' );
231
+		$current = get_site_transient('update_plugins');
232 232
 
233 233
 		add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
234 234
 
235 235
 		$this->skin->header();
236 236
 
237 237
 		// Connect to the Filesystem first.
238
-		$res = $this->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
239
-		if ( ! $res ) {
238
+		$res = $this->fs_connect(array(WP_CONTENT_DIR, WP_PLUGIN_DIR));
239
+		if ( ! $res) {
240 240
 			$this->skin->footer();
241 241
 			return false;
242 242
 		}
@@ -249,21 +249,21 @@  discard block
 block discarded – undo
249 249
 		 * - a plugin with an update available is currently active.
250 250
 		 * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
251 251
 		 */
252
-		$maintenance = ( is_multisite() && ! empty( $plugins ) );
253
-		foreach ( $plugins as $plugin )
254
-			$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
255
-		if ( $maintenance )
252
+		$maintenance = (is_multisite() && ! empty($plugins));
253
+		foreach ($plugins as $plugin)
254
+			$maintenance = $maintenance || (is_plugin_active($plugin) && isset($current->response[$plugin]));
255
+		if ($maintenance)
256 256
 			$this->maintenance_mode(true);
257 257
 
258 258
 		$results = array();
259 259
 
260 260
 		$this->update_count = count($plugins);
261 261
 		$this->update_current = 0;
262
-		foreach ( $plugins as $plugin ) {
262
+		foreach ($plugins as $plugin) {
263 263
 			$this->update_current++;
264
-			$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
264
+			$this->skin->plugin_info = get_plugin_data(WP_PLUGIN_DIR.'/'.$plugin, false, true);
265 265
 
266
-			if ( !isset( $current->response[ $plugin ] ) ) {
266
+			if ( ! isset($current->response[$plugin])) {
267 267
 				$this->skin->set_result('up_to_date');
268 268
 				$this->skin->before();
269 269
 				$this->skin->feedback('up_to_date');
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
 			}
274 274
 
275 275
 			// Get the URL to the zip file.
276
-			$r = $current->response[ $plugin ];
276
+			$r = $current->response[$plugin];
277 277
 
278 278
 			$this->skin->plugin_active = is_plugin_active($plugin);
279 279
 
280
-			$result = $this->run( array(
280
+			$result = $this->run(array(
281 281
 				'package' => $r->package,
282 282
 				'destination' => WP_PLUGIN_DIR,
283 283
 				'clear_destination' => true,
@@ -286,27 +286,27 @@  discard block
 block discarded – undo
286 286
 				'hook_extra' => array(
287 287
 					'plugin' => $plugin
288 288
 				)
289
-			) );
289
+			));
290 290
 
291 291
 			$results[$plugin] = $this->result;
292 292
 
293 293
 			// Prevent credentials auth screen from displaying multiple times
294
-			if ( false === $result )
294
+			if (false === $result)
295 295
 				break;
296 296
 		} //end foreach $plugins
297 297
 
298 298
 		$this->maintenance_mode(false);
299 299
 
300 300
 		// Force refresh of plugin update information.
301
-		wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
301
+		wp_clean_plugins_cache($parsed_args['clear_update_cache']);
302 302
 
303 303
 		/** This action is documented in wp-admin/includes/class-wp-upgrader.php */
304
-		do_action( 'upgrader_process_complete', $this, array(
304
+		do_action('upgrader_process_complete', $this, array(
305 305
 			'action' => 'update',
306 306
 			'type' => 'plugin',
307 307
 			'bulk' => true,
308 308
 			'plugins' => $plugins,
309
-		) );
309
+		));
310 310
 
311 311
 		$this->skin->bulk_footer();
312 312
 
@@ -336,28 +336,28 @@  discard block
 block discarded – undo
336 336
 	public function check_package($source) {
337 337
 		global $wp_filesystem;
338 338
 
339
-		if ( is_wp_error($source) )
339
+		if (is_wp_error($source))
340 340
 			return $source;
341 341
 
342
-		$working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
343
-		if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
342
+		$working_directory = str_replace($wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
343
+		if ( ! is_dir($working_directory)) // Sanity check, if the above fails, let's not prevent installation.
344 344
 			return $source;
345 345
 
346 346
 		// Check the folder contains at least 1 valid plugin.
347 347
 		$plugins_found = false;
348
-		$files = glob( $working_directory . '*.php' );
349
-		if ( $files ) {
350
-			foreach ( $files as $file ) {
351
-				$info = get_plugin_data( $file, false, false );
352
-				if ( ! empty( $info['Name'] ) ) {
348
+		$files = glob($working_directory.'*.php');
349
+		if ($files) {
350
+			foreach ($files as $file) {
351
+				$info = get_plugin_data($file, false, false);
352
+				if ( ! empty($info['Name'])) {
353 353
 					$plugins_found = true;
354 354
 					break;
355 355
 				}
356 356
 			}
357 357
 		}
358 358
 
359
-		if ( ! $plugins_found )
360
-			return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
359
+		if ( ! $plugins_found)
360
+			return new WP_Error('incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __('No valid plugins were found.'));
361 361
 
362 362
 		return $source;
363 363
 	}
@@ -373,18 +373,18 @@  discard block
 block discarded – undo
373 373
 	 * @return string|false The full path to the main plugin file, or false.
374 374
 	 */
375 375
 	public function plugin_info() {
376
-		if ( ! is_array($this->result) )
376
+		if ( ! is_array($this->result))
377 377
 			return false;
378
-		if ( empty($this->result['destination_name']) )
378
+		if (empty($this->result['destination_name']))
379 379
 			return false;
380 380
 
381
-		$plugin = get_plugins('/' . $this->result['destination_name']); //Ensure to pass with leading slash
382
-		if ( empty($plugin) )
381
+		$plugin = get_plugins('/'.$this->result['destination_name']); //Ensure to pass with leading slash
382
+		if (empty($plugin))
383 383
 			return false;
384 384
 
385 385
 		$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
386 386
 
387
-		return $this->result['destination_name'] . '/' . $pluginfiles[0];
387
+		return $this->result['destination_name'].'/'.$pluginfiles[0];
388 388
 	}
389 389
 
390 390
 	/**
@@ -402,18 +402,18 @@  discard block
 block discarded – undo
402 402
 	 */
403 403
 	public function deactivate_plugin_before_upgrade($return, $plugin) {
404 404
 
405
-		if ( is_wp_error($return) ) //Bypass.
405
+		if (is_wp_error($return)) //Bypass.
406 406
 			return $return;
407 407
 
408 408
 		// When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it
409
-		if ( wp_doing_cron() )
409
+		if (wp_doing_cron())
410 410
 			return $return;
411 411
 
412 412
 		$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
413
-		if ( empty($plugin) )
413
+		if (empty($plugin))
414 414
 			return new WP_Error('bad_request', $this->strings['bad_request']);
415 415
 
416
-		if ( is_plugin_active($plugin) ) {
416
+		if (is_plugin_active($plugin)) {
417 417
 			//Deactivate the plugin silently, Prevent deactivation hooks from running.
418 418
 			deactivate_plugins($plugin, true);
419 419
 		}
@@ -441,26 +441,26 @@  discard block
 block discarded – undo
441 441
 	public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
442 442
 		global $wp_filesystem;
443 443
 
444
-		if ( is_wp_error($removed) )
444
+		if (is_wp_error($removed))
445 445
 			return $removed; //Pass errors through.
446 446
 
447 447
 		$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
448
-		if ( empty($plugin) )
448
+		if (empty($plugin))
449 449
 			return new WP_Error('bad_request', $this->strings['bad_request']);
450 450
 
451 451
 		$plugins_dir = $wp_filesystem->wp_plugins_dir();
452
-		$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
452
+		$this_plugin_dir = trailingslashit(dirname($plugins_dir.$plugin));
453 453
 
454
-		if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If it's already vanished.
454
+		if ( ! $wp_filesystem->exists($this_plugin_dir)) //If it's already vanished.
455 455
 			return $removed;
456 456
 
457 457
 		// If plugin is in its own directory, recursively delete the directory.
458
-		if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that it's not the root plugin folder
458
+		if (strpos($plugin, '/') && $this_plugin_dir != $plugins_dir) //base check on if plugin includes directory separator AND that it's not the root plugin folder
459 459
 			$deleted = $wp_filesystem->delete($this_plugin_dir, true);
460 460
 		else
461
-			$deleted = $wp_filesystem->delete($plugins_dir . $plugin);
461
+			$deleted = $wp_filesystem->delete($plugins_dir.$plugin);
462 462
 
463
-		if ( ! $deleted )
463
+		if ( ! $deleted)
464 464
 			return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
465 465
 
466 466
 		return true;
Please login to merge, or discard this patch.
Braces   +60 added lines, -36 removed lines patch added patch discarded remove patch
@@ -120,8 +120,9 @@  discard block
 block discarded – undo
120 120
 		remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
121 121
 		remove_filter('upgrader_source_selection', array($this, 'check_package') );
122 122
 
123
-		if ( ! $this->result || is_wp_error($this->result) )
124
-			return $this->result;
123
+		if ( ! $this->result || is_wp_error($this->result) ) {
124
+					return $this->result;
125
+		}
125 126
 
126 127
 		// Force refresh of plugin update information
127 128
 		wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
@@ -192,8 +193,9 @@  discard block
 block discarded – undo
192 193
 		remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
193 194
 		remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
194 195
 
195
-		if ( ! $this->result || is_wp_error($this->result) )
196
-			return $this->result;
196
+		if ( ! $this->result || is_wp_error($this->result) ) {
197
+					return $this->result;
198
+		}
197 199
 
198 200
 		// Force refresh of plugin update information
199 201
 		wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
@@ -250,10 +252,12 @@  discard block
 block discarded – undo
250 252
 		 * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
251 253
 		 */
252 254
 		$maintenance = ( is_multisite() && ! empty( $plugins ) );
253
-		foreach ( $plugins as $plugin )
254
-			$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
255
-		if ( $maintenance )
256
-			$this->maintenance_mode(true);
255
+		foreach ( $plugins as $plugin ) {
256
+					$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
257
+		}
258
+		if ( $maintenance ) {
259
+					$this->maintenance_mode(true);
260
+		}
257 261
 
258 262
 		$results = array();
259 263
 
@@ -291,8 +295,9 @@  discard block
 block discarded – undo
291 295
 			$results[$plugin] = $this->result;
292 296
 
293 297
 			// Prevent credentials auth screen from displaying multiple times
294
-			if ( false === $result )
295
-				break;
298
+			if ( false === $result ) {
299
+							break;
300
+			}
296 301
 		} //end foreach $plugins
297 302
 
298 303
 		$this->maintenance_mode(false);
@@ -336,12 +341,15 @@  discard block
 block discarded – undo
336 341
 	public function check_package($source) {
337 342
 		global $wp_filesystem;
338 343
 
339
-		if ( is_wp_error($source) )
340
-			return $source;
344
+		if ( is_wp_error($source) ) {
345
+					return $source;
346
+		}
341 347
 
342 348
 		$working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
343
-		if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
349
+		if ( ! is_dir($working_directory) ) {
350
+			// Sanity check, if the above fails, let's not prevent installation.
344 351
 			return $source;
352
+		}
345 353
 
346 354
 		// Check the folder contains at least 1 valid plugin.
347 355
 		$plugins_found = false;
@@ -356,8 +364,9 @@  discard block
 block discarded – undo
356 364
 			}
357 365
 		}
358 366
 
359
-		if ( ! $plugins_found )
360
-			return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
367
+		if ( ! $plugins_found ) {
368
+					return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
369
+		}
361 370
 
362 371
 		return $source;
363 372
 	}
@@ -373,14 +382,17 @@  discard block
 block discarded – undo
373 382
 	 * @return string|false The full path to the main plugin file, or false.
374 383
 	 */
375 384
 	public function plugin_info() {
376
-		if ( ! is_array($this->result) )
377
-			return false;
378
-		if ( empty($this->result['destination_name']) )
379
-			return false;
385
+		if ( ! is_array($this->result) ) {
386
+					return false;
387
+		}
388
+		if ( empty($this->result['destination_name']) ) {
389
+					return false;
390
+		}
380 391
 
381 392
 		$plugin = get_plugins('/' . $this->result['destination_name']); //Ensure to pass with leading slash
382
-		if ( empty($plugin) )
383
-			return false;
393
+		if ( empty($plugin) ) {
394
+					return false;
395
+		}
384 396
 
385 397
 		$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
386 398
 
@@ -402,16 +414,20 @@  discard block
 block discarded – undo
402 414
 	 */
403 415
 	public function deactivate_plugin_before_upgrade($return, $plugin) {
404 416
 
405
-		if ( is_wp_error($return) ) //Bypass.
417
+		if ( is_wp_error($return) ) {
418
+			//Bypass.
406 419
 			return $return;
420
+		}
407 421
 
408 422
 		// When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it
409
-		if ( wp_doing_cron() )
410
-			return $return;
423
+		if ( wp_doing_cron() ) {
424
+					return $return;
425
+		}
411 426
 
412 427
 		$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
413
-		if ( empty($plugin) )
414
-			return new WP_Error('bad_request', $this->strings['bad_request']);
428
+		if ( empty($plugin) ) {
429
+					return new WP_Error('bad_request', $this->strings['bad_request']);
430
+		}
415 431
 
416 432
 		if ( is_plugin_active($plugin) ) {
417 433
 			//Deactivate the plugin silently, Prevent deactivation hooks from running.
@@ -441,27 +457,35 @@  discard block
 block discarded – undo
441 457
 	public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
442 458
 		global $wp_filesystem;
443 459
 
444
-		if ( is_wp_error($removed) )
445
-			return $removed; //Pass errors through.
460
+		if ( is_wp_error($removed) ) {
461
+					return $removed;
462
+		}
463
+		//Pass errors through.
446 464
 
447 465
 		$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
448
-		if ( empty($plugin) )
449
-			return new WP_Error('bad_request', $this->strings['bad_request']);
466
+		if ( empty($plugin) ) {
467
+					return new WP_Error('bad_request', $this->strings['bad_request']);
468
+		}
450 469
 
451 470
 		$plugins_dir = $wp_filesystem->wp_plugins_dir();
452 471
 		$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
453 472
 
454
-		if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If it's already vanished.
473
+		if ( ! $wp_filesystem->exists($this_plugin_dir) ) {
474
+			//If it's already vanished.
455 475
 			return $removed;
476
+		}
456 477
 
457 478
 		// If plugin is in its own directory, recursively delete the directory.
458
-		if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that it's not the root plugin folder
479
+		if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) {
480
+			//base check on if plugin includes directory separator AND that it's not the root plugin folder
459 481
 			$deleted = $wp_filesystem->delete($this_plugin_dir, true);
460
-		else
461
-			$deleted = $wp_filesystem->delete($plugins_dir . $plugin);
482
+		} else {
483
+					$deleted = $wp_filesystem->delete($plugins_dir . $plugin);
484
+		}
462 485
 
463
-		if ( ! $deleted )
464
-			return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
486
+		if ( ! $deleted ) {
487
+					return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
488
+		}
465 489
 
466 490
 		return true;
467 491
 	}
Please login to merge, or discard this patch.
src/wp-admin/includes/list-table.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  *
18 18
  * @param string $class The type of the list table, which is the class name.
19 19
  * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
20
- * @return object|bool Object on success, false if the class does not exist.
20
+ * @return string Object on success, false if the class does not exist.
21 21
  */
22 22
 function _get_list_table( $class, $args = array() ) {
23 23
 	$core_classes = array(
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
20 20
  * @return object|bool Object on success, false if the class does not exist.
21 21
  */
22
-function _get_list_table( $class, $args = array() ) {
22
+function _get_list_table($class, $args = array()) {
23 23
 	$core_classes = array(
24 24
 		//Site Admin
25 25
 		'WP_Posts_List_Table' => 'posts',
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		'WP_Terms_List_Table' => 'terms',
28 28
 		'WP_Users_List_Table' => 'users',
29 29
 		'WP_Comments_List_Table' => 'comments',
30
-		'WP_Post_Comments_List_Table' => array( 'comments', 'post-comments' ),
30
+		'WP_Post_Comments_List_Table' => array('comments', 'post-comments'),
31 31
 		'WP_Links_List_Table' => 'links',
32 32
 		'WP_Plugin_Install_List_Table' => 'plugin-install',
33 33
 		'WP_Themes_List_Table' => 'themes',
34
-		'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
34
+		'WP_Theme_Install_List_Table' => array('themes', 'theme-install'),
35 35
 		'WP_Plugins_List_Table' => 'plugins',
36 36
 		// Network Admin
37 37
 		'WP_MS_Sites_List_Table' => 'ms-sites',
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 		'WP_MS_Themes_List_Table' => 'ms-themes',
40 40
 	);
41 41
 
42
-	if ( isset( $core_classes[ $class ] ) ) {
43
-		foreach ( (array) $core_classes[ $class ] as $required )
44
-			require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
42
+	if (isset($core_classes[$class])) {
43
+		foreach ((array) $core_classes[$class] as $required)
44
+			require_once(ABSPATH.'wp-admin/includes/class-wp-'.$required.'-list-table.php');
45 45
 
46
-		if ( isset( $args['screen'] ) )
47
-			$args['screen'] = convert_to_screen( $args['screen'] );
48
-		elseif ( isset( $GLOBALS['hook_suffix'] ) )
46
+		if (isset($args['screen']))
47
+			$args['screen'] = convert_to_screen($args['screen']);
48
+		elseif (isset($GLOBALS['hook_suffix']))
49 49
 			$args['screen'] = get_current_screen();
50 50
 		else
51 51
 			$args['screen'] = null;
52 52
 
53
-		return new $class( $args );
53
+		return new $class($args);
54 54
 	}
55 55
 
56 56
 	return false;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
  * @see get_column_headers(), print_column_headers(), get_hidden_columns()
67 67
  */
68 68
 function register_column_headers($screen, $columns) {
69
-	new _WP_List_Table_Compat( $screen, $columns );
69
+	new _WP_List_Table_Compat($screen, $columns);
70 70
 }
71 71
 
72 72
 /**
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
  * @param string|WP_Screen $screen  The screen hook name or screen object.
78 78
  * @param bool             $with_id Whether to set the id attribute or not.
79 79
  */
80
-function print_column_headers( $screen, $with_id = true ) {
80
+function print_column_headers($screen, $with_id = true) {
81 81
 	$wp_list_table = new _WP_List_Table_Compat($screen);
82 82
 
83
-	$wp_list_table->print_column_headers( $with_id );
83
+	$wp_list_table->print_column_headers($with_id);
84 84
 }
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,15 +40,17 @@
 block discarded – undo
40 40
 	);
41 41
 
42 42
 	if ( isset( $core_classes[ $class ] ) ) {
43
-		foreach ( (array) $core_classes[ $class ] as $required )
44
-			require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
43
+		foreach ( (array) $core_classes[ $class ] as $required ) {
44
+					require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
45
+		}
45 46
 
46
-		if ( isset( $args['screen'] ) )
47
-			$args['screen'] = convert_to_screen( $args['screen'] );
48
-		elseif ( isset( $GLOBALS['hook_suffix'] ) )
49
-			$args['screen'] = get_current_screen();
50
-		else
51
-			$args['screen'] = null;
47
+		if ( isset( $args['screen'] ) ) {
48
+					$args['screen'] = convert_to_screen( $args['screen'] );
49
+		} elseif ( isset( $GLOBALS['hook_suffix'] ) ) {
50
+					$args['screen'] = get_current_screen();
51
+		} else {
52
+					$args['screen'] = null;
53
+		}
52 54
 
53 55
 		return new $class( $args );
54 56
 	}
Please login to merge, or discard this patch.
src/wp-admin/includes/template.php 3 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -675,10 +675,10 @@  discard block
 block discarded – undo
675 675
  *
676 676
  * @global WP_Locale  $wp_locale
677 677
  *
678
- * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.
679
- * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
678
+ * @param integer $edit      Accepts 1|true for editing the date, 0|false for adding the date.
679
+ * @param integer $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.
680 680
  * @param int      $tab_index The tabindex attribute to add. Default 0.
681
- * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
681
+ * @param integer $multi     Optional. Whether the additional fields and buttons should be added.
682 682
  *                            Default 0|false.
683 683
  */
684 684
 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
  * @staticvar bool $already_sorted
985 985
  * @param string|WP_Screen $screen  Screen identifier
986 986
  * @param string           $context box context
987
- * @param mixed            $object  gets passed to the box callback function as first parameter
987
+ * @param string            $object  gets passed to the box callback function as first parameter
988 988
  * @return int number of meta_boxes
989 989
  */
990 990
 function do_meta_boxes( $screen, $context, $object ) {
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
  *
1534 1534
  * @since 2.7.0
1535 1535
  *
1536
- * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
1536
+ * @param integer $post Optional. Post ID or WP_Post object. Default is global $post.
1537 1537
  * @return string The post title if set.
1538 1538
  */
1539 1539
 function _draft_or_post_title( $post = 0 ) {
Please login to merge, or discard this patch.
Spacing   +470 added lines, -470 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 /** Walker_Category_Checklist class */
12
-require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' );
12
+require_once(ABSPATH.'wp-admin/includes/class-walker-category-checklist.php');
13 13
 
14 14
 /** WP_Internal_Pointers class */
15
-require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' );
15
+require_once(ABSPATH.'wp-admin/includes/class-wp-internal-pointers.php');
16 16
 
17 17
 //
18 18
 // Category Checklists
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
  * @param bool   $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to
38 38
  *                                     the top of the list. Default true.
39 39
  */
40
-function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
41
-	wp_terms_checklist( $post_id, array(
40
+function wp_category_checklist($post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true) {
41
+	wp_terms_checklist($post_id, array(
42 42
 		'taxonomy' => 'category',
43 43
 		'descendants_and_self' => $descendants_and_self,
44 44
 		'selected_cats' => $selected_cats,
45 45
 		'popular_cats' => $popular_cats,
46 46
 		'walker' => $walker,
47 47
 		'checked_ontop' => $checked_ontop
48
-	) );
48
+	));
49 49
 }
50 50
 
51 51
 /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
  *                                        of echoing it. Default true.
75 75
  * }
76 76
  */
77
-function wp_terms_checklist( $post_id = 0, $args = array() ) {
77
+function wp_terms_checklist($post_id = 0, $args = array()) {
78 78
  	$defaults = array(
79 79
 		'descendants_and_self' => 0,
80 80
 		'selected_cats' => false,
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 	 * @param array $args    An array of arguments.
96 96
 	 * @param int   $post_id The post ID.
97 97
 	 */
98
-	$params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
98
+	$params = apply_filters('wp_terms_checklist_args', $args, $post_id);
99 99
 
100
-	$r = wp_parse_args( $params, $defaults );
100
+	$r = wp_parse_args($params, $defaults);
101 101
 
102
-	if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
102
+	if (empty($r['walker']) || ! ($r['walker'] instanceof Walker)) {
103 103
 		$walker = new Walker_Category_Checklist;
104 104
 	} else {
105 105
 		$walker = $r['walker'];
@@ -108,64 +108,64 @@  discard block
 block discarded – undo
108 108
 	$taxonomy = $r['taxonomy'];
109 109
 	$descendants_and_self = (int) $r['descendants_and_self'];
110 110
 
111
-	$args = array( 'taxonomy' => $taxonomy );
111
+	$args = array('taxonomy' => $taxonomy);
112 112
 
113
-	$tax = get_taxonomy( $taxonomy );
114
-	$args['disabled'] = ! current_user_can( $tax->cap->assign_terms );
113
+	$tax = get_taxonomy($taxonomy);
114
+	$args['disabled'] = ! current_user_can($tax->cap->assign_terms);
115 115
 
116
-	$args['list_only'] = ! empty( $r['list_only'] );
116
+	$args['list_only'] = ! empty($r['list_only']);
117 117
 
118
-	if ( is_array( $r['selected_cats'] ) ) {
118
+	if (is_array($r['selected_cats'])) {
119 119
 		$args['selected_cats'] = $r['selected_cats'];
120
-	} elseif ( $post_id ) {
121
-		$args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );
120
+	} elseif ($post_id) {
121
+		$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
122 122
 	} else {
123 123
 		$args['selected_cats'] = array();
124 124
 	}
125
-	if ( is_array( $r['popular_cats'] ) ) {
125
+	if (is_array($r['popular_cats'])) {
126 126
 		$args['popular_cats'] = $r['popular_cats'];
127 127
 	} else {
128
-		$args['popular_cats'] = get_terms( $taxonomy, array(
128
+		$args['popular_cats'] = get_terms($taxonomy, array(
129 129
 			'fields' => 'ids',
130 130
 			'orderby' => 'count',
131 131
 			'order' => 'DESC',
132 132
 			'number' => 10,
133 133
 			'hierarchical' => false
134
-		) );
134
+		));
135 135
 	}
136
-	if ( $descendants_and_self ) {
137
-		$categories = (array) get_terms( $taxonomy, array(
136
+	if ($descendants_and_self) {
137
+		$categories = (array) get_terms($taxonomy, array(
138 138
 			'child_of' => $descendants_and_self,
139 139
 			'hierarchical' => 0,
140 140
 			'hide_empty' => 0
141
-		) );
142
-		$self = get_term( $descendants_and_self, $taxonomy );
143
-		array_unshift( $categories, $self );
141
+		));
142
+		$self = get_term($descendants_and_self, $taxonomy);
143
+		array_unshift($categories, $self);
144 144
 	} else {
145
-		$categories = (array) get_terms( $taxonomy, array( 'get' => 'all' ) );
145
+		$categories = (array) get_terms($taxonomy, array('get' => 'all'));
146 146
 	}
147 147
 
148 148
 	$output = '';
149 149
 
150
-	if ( $r['checked_ontop'] ) {
150
+	if ($r['checked_ontop']) {
151 151
 		// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
152 152
 		$checked_categories = array();
153
-		$keys = array_keys( $categories );
153
+		$keys = array_keys($categories);
154 154
 
155
-		foreach ( $keys as $k ) {
156
-			if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
155
+		foreach ($keys as $k) {
156
+			if (in_array($categories[$k]->term_id, $args['selected_cats'])) {
157 157
 				$checked_categories[] = $categories[$k];
158
-				unset( $categories[$k] );
158
+				unset($categories[$k]);
159 159
 			}
160 160
 		}
161 161
 
162 162
 		// Put checked cats on top
163
-		$output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) );
163
+		$output .= call_user_func_array(array($walker, 'walk'), array($checked_categories, 0, $args));
164 164
 	}
165 165
 	// Then the rest of them
166
-	$output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) );
166
+	$output .= call_user_func_array(array($walker, 'walk'), array($categories, 0, $args));
167 167
 
168
-	if ( $r['echo'] ) {
168
+	if ($r['echo']) {
169 169
 		echo $output;
170 170
 	}
171 171
 
@@ -188,33 +188,33 @@  discard block
 block discarded – undo
188 188
  * @param bool $echo Optionally output the list as well. Defaults to true.
189 189
  * @return array List of popular term IDs.
190 190
  */
191
-function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
191
+function wp_popular_terms_checklist($taxonomy, $default = 0, $number = 10, $echo = true) {
192 192
 	$post = get_post();
193 193
 
194
-	if ( $post && $post->ID )
194
+	if ($post && $post->ID)
195 195
 		$checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids'));
196 196
 	else
197 197
 		$checked_terms = array();
198 198
 
199
-	$terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
199
+	$terms = get_terms($taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false));
200 200
 
201 201
 	$tax = get_taxonomy($taxonomy);
202 202
 
203 203
 	$popular_ids = array();
204
-	foreach ( (array) $terms as $term ) {
204
+	foreach ((array) $terms as $term) {
205 205
 		$popular_ids[] = $term->term_id;
206
-		if ( !$echo ) // Hack for Ajax use.
206
+		if ( ! $echo) // Hack for Ajax use.
207 207
 			continue;
208 208
 		$id = "popular-$taxonomy-$term->term_id";
209
-		$checked = in_array( $term->term_id, $checked_terms ) ? 'checked="checked"' : '';
209
+		$checked = in_array($term->term_id, $checked_terms) ? 'checked="checked"' : '';
210 210
 		?>
211 211
 
212 212
 		<li id="<?php echo $id; ?>" class="popular-category">
213 213
 			<label class="selectit">
214
-				<input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
214
+				<input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can($tax->cap->assign_terms)); ?> />
215 215
 				<?php
216 216
 				/** This filter is documented in wp-includes/category-template.php */
217
-				echo esc_html( apply_filters( 'the_category', $term->name ) );
217
+				echo esc_html(apply_filters('the_category', $term->name));
218 218
 				?>
219 219
 			</label>
220 220
 		</li>
@@ -231,32 +231,32 @@  discard block
 block discarded – undo
231 231
  *
232 232
  * @param int $link_id
233 233
  */
234
-function wp_link_category_checklist( $link_id = 0 ) {
234
+function wp_link_category_checklist($link_id = 0) {
235 235
 	$default = 1;
236 236
 
237 237
 	$checked_categories = array();
238 238
 
239
-	if ( $link_id ) {
240
-		$checked_categories = wp_get_link_cats( $link_id );
239
+	if ($link_id) {
240
+		$checked_categories = wp_get_link_cats($link_id);
241 241
 		// No selected categories, strange
242
-		if ( ! count( $checked_categories ) ) {
242
+		if ( ! count($checked_categories)) {
243 243
 			$checked_categories[] = $default;
244 244
 		}
245 245
 	} else {
246 246
 		$checked_categories[] = $default;
247 247
 	}
248 248
 
249
-	$categories = get_terms( 'link_category', array( 'orderby' => 'name', 'hide_empty' => 0 ) );
249
+	$categories = get_terms('link_category', array('orderby' => 'name', 'hide_empty' => 0));
250 250
 
251
-	if ( empty( $categories ) )
251
+	if (empty($categories))
252 252
 		return;
253 253
 
254
-	foreach ( $categories as $category ) {
254
+	foreach ($categories as $category) {
255 255
 		$cat_id = $category->term_id;
256 256
 
257 257
 		/** This filter is documented in wp-includes/category-template.php */
258
-		$name = esc_html( apply_filters( 'the_category', $category->name ) );
259
-		$checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
258
+		$name = esc_html(apply_filters('the_category', $category->name));
259
+		$checked = in_array($cat_id, $checked_categories) ? ' checked="checked"' : '';
260 260
 		echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
261 261
 	}
262 262
 }
@@ -270,72 +270,72 @@  discard block
 block discarded – undo
270 270
  */
271 271
 function get_inline_data($post) {
272 272
 	$post_type_object = get_post_type_object($post->post_type);
273
-	if ( ! current_user_can( 'edit_post', $post->ID ) )
273
+	if ( ! current_user_can('edit_post', $post->ID))
274 274
 		return;
275 275
 
276
-	$title = esc_textarea( trim( $post->post_title ) );
276
+	$title = esc_textarea(trim($post->post_title));
277 277
 
278 278
 	/** This filter is documented in wp-admin/edit-tag-form.php */
279 279
 	echo '
280
-<div class="hidden" id="inline_' . $post->ID . '">
281
-	<div class="post_title">' . $title . '</div>' .
280
+<div class="hidden" id="inline_' . $post->ID.'">
281
+	<div class="post_title">' . $title.'</div>'.
282 282
 	/** This filter is documented in wp-admin/edit-tag-form.php */
283
-	'<div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div>
284
-	<div class="post_author">' . $post->post_author . '</div>
285
-	<div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
286
-	<div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
287
-	<div class="_status">' . esc_html( $post->post_status ) . '</div>
288
-	<div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
289
-	<div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
290
-	<div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
291
-	<div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div>
292
-	<div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div>
293
-	<div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div>
294
-	<div class="post_password">' . esc_html( $post->post_password ) . '</div>';
295
-
296
-	if ( $post_type_object->hierarchical ) {
297
-		echo '<div class="post_parent">' . $post->post_parent . '</div>';
283
+	'<div class="post_name">'.apply_filters('editable_slug', $post->post_name, $post).'</div>
284
+	<div class="post_author">' . $post->post_author.'</div>
285
+	<div class="comment_status">' . esc_html($post->comment_status).'</div>
286
+	<div class="ping_status">' . esc_html($post->ping_status).'</div>
287
+	<div class="_status">' . esc_html($post->post_status).'</div>
288
+	<div class="jj">' . mysql2date('d', $post->post_date, false).'</div>
289
+	<div class="mm">' . mysql2date('m', $post->post_date, false).'</div>
290
+	<div class="aa">' . mysql2date('Y', $post->post_date, false).'</div>
291
+	<div class="hh">' . mysql2date('H', $post->post_date, false).'</div>
292
+	<div class="mn">' . mysql2date('i', $post->post_date, false).'</div>
293
+	<div class="ss">' . mysql2date('s', $post->post_date, false).'</div>
294
+	<div class="post_password">' . esc_html($post->post_password).'</div>';
295
+
296
+	if ($post_type_object->hierarchical) {
297
+		echo '<div class="post_parent">'.$post->post_parent.'</div>';
298 298
 	}
299 299
 
300
-	echo '<div class="page_template">' . ( $post->page_template ? esc_html( $post->page_template ) : 'default' ) . '</div>';
300
+	echo '<div class="page_template">'.($post->page_template ? esc_html($post->page_template) : 'default').'</div>';
301 301
 
302
-	if ( post_type_supports( $post->post_type, 'page-attributes' ) ) {
303
-		echo '<div class="menu_order">' . $post->menu_order . '</div>';
302
+	if (post_type_supports($post->post_type, 'page-attributes')) {
303
+		echo '<div class="menu_order">'.$post->menu_order.'</div>';
304 304
 	}
305 305
 
306
-	$taxonomy_names = get_object_taxonomies( $post->post_type );
307
-	foreach ( $taxonomy_names as $taxonomy_name) {
308
-		$taxonomy = get_taxonomy( $taxonomy_name );
306
+	$taxonomy_names = get_object_taxonomies($post->post_type);
307
+	foreach ($taxonomy_names as $taxonomy_name) {
308
+		$taxonomy = get_taxonomy($taxonomy_name);
309 309
 
310
-		if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
310
+		if ($taxonomy->hierarchical && $taxonomy->show_ui) {
311 311
 
312
-			$terms = get_object_term_cache( $post->ID, $taxonomy_name );
313
-			if ( false === $terms ) {
314
-				$terms = wp_get_object_terms( $post->ID, $taxonomy_name );
315
-				wp_cache_add( $post->ID, wp_list_pluck( $terms, 'term_id' ), $taxonomy_name . '_relationships' );
312
+			$terms = get_object_term_cache($post->ID, $taxonomy_name);
313
+			if (false === $terms) {
314
+				$terms = wp_get_object_terms($post->ID, $taxonomy_name);
315
+				wp_cache_add($post->ID, wp_list_pluck($terms, 'term_id'), $taxonomy_name.'_relationships');
316 316
 			}
317
-			$term_ids = empty( $terms ) ? array() : wp_list_pluck( $terms, 'term_id' );
317
+			$term_ids = empty($terms) ? array() : wp_list_pluck($terms, 'term_id');
318 318
 
319
-			echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' . implode( ',', $term_ids ) . '</div>';
319
+			echo '<div class="post_category" id="'.$taxonomy_name.'_'.$post->ID.'">'.implode(',', $term_ids).'</div>';
320 320
 
321
-		} elseif ( $taxonomy->show_ui ) {
321
+		} elseif ($taxonomy->show_ui) {
322 322
 
323
-			$terms_to_edit = get_terms_to_edit( $post->ID, $taxonomy_name );
324
-			if ( ! is_string( $terms_to_edit ) ) {
323
+			$terms_to_edit = get_terms_to_edit($post->ID, $taxonomy_name);
324
+			if ( ! is_string($terms_to_edit)) {
325 325
 				$terms_to_edit = '';
326 326
 			}
327 327
 
328 328
 			echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">'
329
-				. esc_html( str_replace( ',', ', ', $terms_to_edit ) ) . '</div>';
329
+				. esc_html(str_replace(',', ', ', $terms_to_edit)).'</div>';
330 330
 
331 331
 		}
332 332
 	}
333 333
 
334
-	if ( !$post_type_object->hierarchical )
335
-		echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
334
+	if ( ! $post_type_object->hierarchical)
335
+		echo '<div class="sticky">'.(is_sticky($post->ID) ? 'sticky' : '').'</div>';
336 336
 
337
-	if ( post_type_supports( $post->post_type, 'post-formats' ) )
338
-		echo '<div class="post_format">' . esc_html( get_post_format( $post->ID ) ) . '</div>';
337
+	if (post_type_supports($post->post_type, 'post-formats'))
338
+		echo '<div class="post_format">'.esc_html(get_post_format($post->ID)).'</div>';
339 339
 
340 340
 	echo '</div>';
341 341
 }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
  * @param string $mode
353 353
  * @param bool   $table_row
354 354
  */
355
-function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $table_row = true ) {
355
+function wp_comment_reply($position = 1, $checkbox = false, $mode = 'single', $table_row = true) {
356 356
 	global $wp_list_table;
357 357
 	/**
358 358
 	 * Filters the in-line comment reply-to form output in the Comments
@@ -369,15 +369,15 @@  discard block
 block discarded – undo
369 369
 	 * @param string $content The reply-to form content.
370 370
 	 * @param array  $args    An array of default args.
371 371
 	 */
372
-	$content = apply_filters( 'wp_comment_reply', '', array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode ) );
372
+	$content = apply_filters('wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode));
373 373
 
374
-	if ( ! empty($content) ) {
374
+	if ( ! empty($content)) {
375 375
 		echo $content;
376 376
 		return;
377 377
 	}
378 378
 
379
-	if ( ! $wp_list_table ) {
380
-		if ( $mode == 'single' ) {
379
+	if ( ! $wp_list_table) {
380
+		if ($mode == 'single') {
381 381
 			$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
382 382
 		} else {
383 383
 			$wp_list_table = _get_list_table('WP_Comments_List_Table');
@@ -386,29 +386,29 @@  discard block
 block discarded – undo
386 386
 
387 387
 ?>
388 388
 <form method="get">
389
-<?php if ( $table_row ) : ?>
389
+<?php if ($table_row) : ?>
390 390
 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
391 391
 <?php else : ?>
392 392
 <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
393 393
 <?php endif; ?>
394 394
 	<fieldset class="comment-reply">
395 395
 	<legend>
396
-		<span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span>
397
-		<span class="hidden" id="replyhead"><?php _e( 'Reply to Comment' ); ?></span>
398
-		<span class="hidden" id="addhead"><?php _e( 'Add new Comment' ); ?></span>
396
+		<span class="hidden" id="editlegend"><?php _e('Edit Comment'); ?></span>
397
+		<span class="hidden" id="replyhead"><?php _e('Reply to Comment'); ?></span>
398
+		<span class="hidden" id="addhead"><?php _e('Add new Comment'); ?></span>
399 399
 	</legend>
400 400
 
401 401
 	<div id="replycontainer">
402
-	<label for="replycontent" class="screen-reader-text"><?php _e( 'Comment' ); ?></label>
402
+	<label for="replycontent" class="screen-reader-text"><?php _e('Comment'); ?></label>
403 403
 	<?php
404
-	$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
405
-	wp_editor( '', 'replycontent', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
404
+	$quicktags_settings = array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');
405
+	wp_editor('', 'replycontent', array('media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings));
406 406
 	?>
407 407
 	</div>
408 408
 
409 409
 	<div id="edithead" style="display:none;">
410 410
 		<div class="inside">
411
-		<label for="author-name"><?php _e( 'Name' ) ?></label>
411
+		<label for="author-name"><?php _e('Name') ?></label>
412 412
 		<input type="text" name="newcomment_author" size="50" value="" id="author-name" />
413 413
 		</div>
414 414
 
@@ -441,12 +441,12 @@  discard block
 block discarded – undo
441 441
 	<input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
442 442
 	<input type="hidden" name="mode" id="mode" value="<?php echo esc_attr($mode); ?>" />
443 443
 	<?php
444
-		wp_nonce_field( 'replyto-comment', '_ajax_nonce-replyto-comment', false );
445
-		if ( current_user_can( 'unfiltered_html' ) )
446
-			wp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );
444
+		wp_nonce_field('replyto-comment', '_ajax_nonce-replyto-comment', false);
445
+		if (current_user_can('unfiltered_html'))
446
+			wp_nonce_field('unfiltered-html-comment', '_wp_unfiltered_html_comment', false);
447 447
 	?>
448 448
 	</fieldset>
449
-<?php if ( $table_row ) : ?>
449
+<?php if ($table_row) : ?>
450 450
 </td></tr></tbody></table>
451 451
 <?php else : ?>
452 452
 </div></div>
@@ -478,15 +478,15 @@  discard block
 block discarded – undo
478 478
  *
479 479
  * @param array $meta
480 480
  */
481
-function list_meta( $meta ) {
481
+function list_meta($meta) {
482 482
 	// Exit if no meta
483
-	if ( ! $meta ) {
483
+	if ( ! $meta) {
484 484
 		echo '
485 485
 <table id="list-table" style="display: none;">
486 486
 	<thead>
487 487
 	<tr>
488
-		<th class="left">' . _x( 'Name', 'meta name' ) . '</th>
489
-		<th>' . __( 'Value' ) . '</th>
488
+		<th class="left">' . _x('Name', 'meta name').'</th>
489
+		<th>' . __('Value').'</th>
490 490
 	</tr>
491 491
 	</thead>
492 492
 	<tbody id="the-list" data-wp-lists="list:meta">
@@ -500,14 +500,14 @@  discard block
 block discarded – undo
500 500
 <table id="list-table">
501 501
 	<thead>
502 502
 	<tr>
503
-		<th class="left"><?php _ex( 'Name', 'meta name' ) ?></th>
504
-		<th><?php _e( 'Value' ) ?></th>
503
+		<th class="left"><?php _ex('Name', 'meta name') ?></th>
504
+		<th><?php _e('Value') ?></th>
505 505
 	</tr>
506 506
 	</thead>
507 507
 	<tbody id='the-list' data-wp-lists='list:meta'>
508 508
 <?php
509
-	foreach ( $meta as $entry )
510
-		echo _list_meta_row( $entry, $count );
509
+	foreach ($meta as $entry)
510
+		echo _list_meta_row($entry, $count);
511 511
 ?>
512 512
 	</tbody>
513 513
 </table>
@@ -525,22 +525,22 @@  discard block
 block discarded – undo
525 525
  * @param int   $count
526 526
  * @return string
527 527
  */
528
-function _list_meta_row( $entry, &$count ) {
528
+function _list_meta_row($entry, &$count) {
529 529
 	static $update_nonce = '';
530 530
 
531
-	if ( is_protected_meta( $entry['meta_key'], 'post' ) )
531
+	if (is_protected_meta($entry['meta_key'], 'post'))
532 532
 		return '';
533 533
 
534
-	if ( ! $update_nonce )
535
-		$update_nonce = wp_create_nonce( 'add-meta' );
534
+	if ( ! $update_nonce)
535
+		$update_nonce = wp_create_nonce('add-meta');
536 536
 
537 537
 	$r = '';
538
-	++ $count;
538
+	++$count;
539 539
 
540
-	if ( is_serialized( $entry['meta_value'] ) ) {
541
-		if ( is_serialized_string( $entry['meta_value'] ) ) {
540
+	if (is_serialized($entry['meta_value'])) {
541
+		if (is_serialized_string($entry['meta_value'])) {
542 542
 			// This is a serialized string, so we should display it.
543
-			$entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );
543
+			$entry['meta_value'] = maybe_unserialize($entry['meta_value']);
544 544
 		} else {
545 545
 			// This is a serialized array/object so we should NOT display it.
546 546
 			--$count;
@@ -549,23 +549,23 @@  discard block
 block discarded – undo
549 549
 	}
550 550
 
551 551
 	$entry['meta_key'] = esc_attr($entry['meta_key']);
552
-	$entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a <textarea />
552
+	$entry['meta_value'] = esc_textarea($entry['meta_value']); // using a <textarea />
553 553
 	$entry['meta_id'] = (int) $entry['meta_id'];
554 554
 
555
-	$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
555
+	$delete_nonce = wp_create_nonce('delete-meta_'.$entry['meta_id']);
556 556
 
557 557
 	$r .= "\n\t<tr id='meta-{$entry['meta_id']}'>";
558
-	$r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta-{$entry['meta_id']}-key'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta-{$entry['meta_id']}-key' type='text' size='20' value='{$entry['meta_key']}' />";
558
+	$r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta-{$entry['meta_id']}-key'>".__('Key')."</label><input name='meta[{$entry['meta_id']}][key]' id='meta-{$entry['meta_id']}-key' type='text' size='20' value='{$entry['meta_key']}' />";
559 559
 
560 560
 	$r .= "\n\t\t<div class='submit'>";
561
-	$r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) );
561
+	$r .= get_submit_button(__('Delete'), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array('data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce"));
562 562
 	$r .= "\n\t\t";
563
-	$r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) );
563
+	$r .= get_submit_button(__('Update'), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array('data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce"));
564 564
 	$r .= "</div>";
565
-	$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
565
+	$r .= wp_nonce_field('change-meta', '_ajax_nonce', false, false);
566 566
 	$r .= "</td>";
567 567
 
568
-	$r .= "\n\t\t<td><label class='screen-reader-text' for='meta-{$entry['meta_id']}-value'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta-{$entry['meta_id']}-value' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
568
+	$r .= "\n\t\t<td><label class='screen-reader-text' for='meta-{$entry['meta_id']}-value'>".__('Value')."</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta-{$entry['meta_id']}-value' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
569 569
 	return $r;
570 570
 }
571 571
 
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
  *
579 579
  * @param WP_Post $post Optional. The post being edited.
580 580
  */
581
-function meta_form( $post = null ) {
581
+function meta_form($post = null) {
582 582
 	global $wpdb;
583
-	$post = get_post( $post );
583
+	$post = get_post($post);
584 584
 
585 585
 	/**
586 586
 	 * Filters values for the meta key dropdown in the Custom Fields meta box.
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
 	 * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null.
594 594
 	 * @param WP_Post    $post The current post object.
595 595
 	 */
596
-	$keys = apply_filters( 'postmeta_form_keys', null, $post );
596
+	$keys = apply_filters('postmeta_form_keys', null, $post);
597 597
 
598
-	if ( null === $keys ) {
598
+	if (null === $keys) {
599 599
 		/**
600 600
 		 * Filters the number of custom fields to retrieve for the drop-down
601 601
 		 * in the Custom Fields meta box.
@@ -604,44 +604,44 @@  discard block
 block discarded – undo
604 604
 		 *
605 605
 		 * @param int $limit Number of custom fields to retrieve. Default 30.
606 606
 		 */
607
-		$limit = apply_filters( 'postmeta_form_limit', 30 );
607
+		$limit = apply_filters('postmeta_form_limit', 30);
608 608
 		$sql = "SELECT DISTINCT meta_key
609 609
 			FROM $wpdb->postmeta
610 610
 			WHERE meta_key NOT BETWEEN '_' AND '_z'
611 611
 			HAVING meta_key NOT LIKE %s
612 612
 			ORDER BY meta_key
613 613
 			LIMIT %d";
614
-		$keys = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
614
+		$keys = $wpdb->get_col($wpdb->prepare($sql, $wpdb->esc_like('_').'%', $limit));
615 615
 	}
616 616
 
617
-	if ( $keys ) {
618
-		natcasesort( $keys );
617
+	if ($keys) {
618
+		natcasesort($keys);
619 619
 		$meta_key_input_id = 'metakeyselect';
620 620
 	} else {
621 621
 		$meta_key_input_id = 'metakeyinput';
622 622
 	}
623 623
 ?>
624
-<p><strong><?php _e( 'Add New Custom Field:' ) ?></strong></p>
624
+<p><strong><?php _e('Add New Custom Field:') ?></strong></p>
625 625
 <table id="newmeta">
626 626
 <thead>
627 627
 <tr>
628
-<th class="left"><label for="<?php echo $meta_key_input_id; ?>"><?php _ex( 'Name', 'meta name' ) ?></label></th>
629
-<th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
628
+<th class="left"><label for="<?php echo $meta_key_input_id; ?>"><?php _ex('Name', 'meta name') ?></label></th>
629
+<th><label for="metavalue"><?php _e('Value') ?></label></th>
630 630
 </tr>
631 631
 </thead>
632 632
 
633 633
 <tbody>
634 634
 <tr>
635 635
 <td id="newmetaleft" class="left">
636
-<?php if ( $keys ) { ?>
636
+<?php if ($keys) { ?>
637 637
 <select id="metakeyselect" name="metakeyselect">
638
-<option value="#NONE#"><?php _e( '&mdash; Select &mdash;' ); ?></option>
638
+<option value="#NONE#"><?php _e('&mdash; Select &mdash;'); ?></option>
639 639
 <?php
640 640
 
641
-	foreach ( $keys as $key ) {
642
-		if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) )
641
+	foreach ($keys as $key) {
642
+		if (is_protected_meta($key, 'post') || ! current_user_can('add_post_meta', $post->ID, $key))
643 643
 			continue;
644
-		echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>";
644
+		echo "\n<option value='".esc_attr($key)."'>".esc_html($key)."</option>";
645 645
 	}
646 646
 ?>
647 647
 </select>
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
 
659 659
 <tr><td colspan="2">
660 660
 <div class="submit">
661
-<?php submit_button( __( 'Add Custom Field' ), '', 'addmeta', false, array( 'id' => 'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta' ) ); ?>
661
+<?php submit_button(__('Add Custom Field'), '', 'addmeta', false, array('id' => 'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta')); ?>
662 662
 </div>
663
-<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
663
+<?php wp_nonce_field('add-meta', '_ajax_nonce-add-meta', false); ?>
664 664
 </td></tr>
665 665
 </tbody>
666 666
 </table>
@@ -682,15 +682,15 @@  discard block
 block discarded – undo
682 682
  * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.
683 683
  *                            Default 0|false.
684 684
  */
685
-function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
685
+function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0) {
686 686
 	global $wp_locale;
687 687
 	$post = get_post();
688 688
 
689
-	if ( $for_post )
690
-		$edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
689
+	if ($for_post)
690
+		$edit = ! (in_array($post->post_status, array('draft', 'pending')) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt));
691 691
 
692 692
 	$tab_index_attribute = '';
693
-	if ( (int) $tab_index > 0 )
693
+	if ((int) $tab_index > 0)
694 694
 		$tab_index_attribute = " tabindex=\"$tab_index\"";
695 695
 
696 696
 	// todo: Remove this?
@@ -698,56 +698,56 @@  discard block
 block discarded – undo
698 698
 
699 699
 	$time_adj = current_time('timestamp');
700 700
 	$post_date = ($for_post) ? $post->post_date : get_comment()->comment_date;
701
-	$jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
702
-	$mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
703
-	$aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj );
704
-	$hh = ($edit) ? mysql2date( 'H', $post_date, false ) : gmdate( 'H', $time_adj );
705
-	$mn = ($edit) ? mysql2date( 'i', $post_date, false ) : gmdate( 'i', $time_adj );
706
-	$ss = ($edit) ? mysql2date( 's', $post_date, false ) : gmdate( 's', $time_adj );
707
-
708
-	$cur_jj = gmdate( 'd', $time_adj );
709
-	$cur_mm = gmdate( 'm', $time_adj );
710
-	$cur_aa = gmdate( 'Y', $time_adj );
711
-	$cur_hh = gmdate( 'H', $time_adj );
712
-	$cur_mn = gmdate( 'i', $time_adj );
713
-
714
-	$month = '<label><span class="screen-reader-text">' . __( 'Month' ) . '</span><select ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
715
-	for ( $i = 1; $i < 13; $i = $i +1 ) {
701
+	$jj = ($edit) ? mysql2date('d', $post_date, false) : gmdate('d', $time_adj);
702
+	$mm = ($edit) ? mysql2date('m', $post_date, false) : gmdate('m', $time_adj);
703
+	$aa = ($edit) ? mysql2date('Y', $post_date, false) : gmdate('Y', $time_adj);
704
+	$hh = ($edit) ? mysql2date('H', $post_date, false) : gmdate('H', $time_adj);
705
+	$mn = ($edit) ? mysql2date('i', $post_date, false) : gmdate('i', $time_adj);
706
+	$ss = ($edit) ? mysql2date('s', $post_date, false) : gmdate('s', $time_adj);
707
+
708
+	$cur_jj = gmdate('d', $time_adj);
709
+	$cur_mm = gmdate('m', $time_adj);
710
+	$cur_aa = gmdate('Y', $time_adj);
711
+	$cur_hh = gmdate('H', $time_adj);
712
+	$cur_mn = gmdate('i', $time_adj);
713
+
714
+	$month = '<label><span class="screen-reader-text">'.__('Month').'</span><select '.($multi ? '' : 'id="mm" ').'name="mm"'.$tab_index_attribute.">\n";
715
+	for ($i = 1; $i < 13; $i = $i + 1) {
716 716
 		$monthnum = zeroise($i, 2);
717
-		$monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
718
-		$month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum, $mm, false ) . '>';
717
+		$monthtext = $wp_locale->get_month_abbrev($wp_locale->get_month($i));
718
+		$month .= "\t\t\t".'<option value="'.$monthnum.'" data-text="'.$monthtext.'" '.selected($monthnum, $mm, false).'>';
719 719
 		/* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
720
-		$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . "</option>\n";
720
+		$month .= sprintf(__('%1$s-%2$s'), $monthnum, $monthtext)."</option>\n";
721 721
 	}
722 722
 	$month .= '</select></label>';
723 723
 
724
-	$day = '<label><span class="screen-reader-text">' . __( 'Day' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
725
-	$year = '<label><span class="screen-reader-text">' . __( 'Year' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
726
-	$hour = '<label><span class="screen-reader-text">' . __( 'Hour' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
727
-	$minute = '<label><span class="screen-reader-text">' . __( 'Minute' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
724
+	$day = '<label><span class="screen-reader-text">'.__('Day').'</span><input type="text" '.($multi ? '' : 'id="jj" ').'name="jj" value="'.$jj.'" size="2" maxlength="2"'.$tab_index_attribute.' autocomplete="off" /></label>';
725
+	$year = '<label><span class="screen-reader-text">'.__('Year').'</span><input type="text" '.($multi ? '' : 'id="aa" ').'name="aa" value="'.$aa.'" size="4" maxlength="4"'.$tab_index_attribute.' autocomplete="off" /></label>';
726
+	$hour = '<label><span class="screen-reader-text">'.__('Hour').'</span><input type="text" '.($multi ? '' : 'id="hh" ').'name="hh" value="'.$hh.'" size="2" maxlength="2"'.$tab_index_attribute.' autocomplete="off" /></label>';
727
+	$minute = '<label><span class="screen-reader-text">'.__('Minute').'</span><input type="text" '.($multi ? '' : 'id="mn" ').'name="mn" value="'.$mn.'" size="2" maxlength="2"'.$tab_index_attribute.' autocomplete="off" /></label>';
728 728
 
729 729
 	echo '<div class="timestamp-wrap">';
730 730
 	/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
731
-	printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
731
+	printf(__('%1$s %2$s, %3$s @ %4$s:%5$s'), $month, $day, $year, $hour, $minute);
732 732
 
733
-	echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
733
+	echo '</div><input type="hidden" id="ss" name="ss" value="'.$ss.'" />';
734 734
 
735
-	if ( $multi ) return;
735
+	if ($multi) return;
736 736
 
737 737
 	echo "\n\n";
738 738
 	$map = array(
739
-		'mm' => array( $mm, $cur_mm ),
740
-		'jj' => array( $jj, $cur_jj ),
741
-		'aa' => array( $aa, $cur_aa ),
742
-		'hh' => array( $hh, $cur_hh ),
743
-		'mn' => array( $mn, $cur_mn ),
739
+		'mm' => array($mm, $cur_mm),
740
+		'jj' => array($jj, $cur_jj),
741
+		'aa' => array($aa, $cur_aa),
742
+		'hh' => array($hh, $cur_hh),
743
+		'mn' => array($mn, $cur_mn),
744 744
 	);
745
-	foreach ( $map as $timeunit => $value ) {
746
-		list( $unit, $curr ) = $value;
745
+	foreach ($map as $timeunit => $value) {
746
+		list($unit, $curr) = $value;
747 747
 
748
-		echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
749
-		$cur_timeunit = 'cur_' . $timeunit;
750
-		echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
748
+		echo '<input type="hidden" id="hidden_'.$timeunit.'" name="hidden_'.$timeunit.'" value="'.$unit.'" />'."\n";
749
+		$cur_timeunit = 'cur_'.$timeunit;
750
+		echo '<input type="hidden" id="'.$cur_timeunit.'" name="'.$cur_timeunit.'" value="'.$curr.'" />'."\n";
751 751
 	}
752 752
 ?>
753 753
 
@@ -767,12 +767,12 @@  discard block
 block discarded – undo
767 767
  * @param string $default   Optional. The template file name. Default empty.
768 768
  * @param string $post_type Optional. Post type to get templates for. Default 'post'.
769 769
  */
770
-function page_template_dropdown( $default = '', $post_type = 'page' ) {
771
-	$templates = get_page_templates( null, $post_type );
772
-	ksort( $templates );
773
-	foreach ( array_keys( $templates ) as $template ) {
774
-		$selected = selected( $default, $templates[ $template ], false );
775
-		echo "\n\t<option value='" . $templates[ $template ] . "' $selected>$template</option>";
770
+function page_template_dropdown($default = '', $post_type = 'page') {
771
+	$templates = get_page_templates(null, $post_type);
772
+	ksort($templates);
773
+	foreach (array_keys($templates) as $template) {
774
+		$selected = selected($default, $templates[$template], false);
775
+		echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
776 776
 	}
777 777
 }
778 778
 
@@ -791,22 +791,22 @@  discard block
 block discarded – undo
791 791
  *
792 792
  * @return null|false Boolean False if page has no children, otherwise print out html elements
793 793
  */
794
-function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) {
794
+function parent_dropdown($default = 0, $parent = 0, $level = 0, $post = null) {
795 795
 	global $wpdb;
796
-	$post = get_post( $post );
797
-	$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
796
+	$post = get_post($post);
797
+	$items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent));
798 798
 
799
-	if ( $items ) {
800
-		foreach ( $items as $item ) {
799
+	if ($items) {
800
+		foreach ($items as $item) {
801 801
 			// A page cannot be its own parent.
802
-			if ( $post && $post->ID && $item->ID == $post->ID )
802
+			if ($post && $post->ID && $item->ID == $post->ID)
803 803
 				continue;
804 804
 
805
-			$pad = str_repeat( '&nbsp;', $level * 3 );
806
-			$selected = selected( $default, $item->ID, false );
805
+			$pad = str_repeat('&nbsp;', $level * 3);
806
+			$selected = selected($default, $item->ID, false);
807 807
 
808
-			echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad " . esc_html($item->post_title) . "</option>";
809
-			parent_dropdown( $default, $item->ID, $level +1 );
808
+			echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad ".esc_html($item->post_title)."</option>";
809
+			parent_dropdown($default, $item->ID, $level + 1);
810 810
 		}
811 811
 	} else {
812 812
 		return false;
@@ -820,18 +820,18 @@  discard block
 block discarded – undo
820 820
  *
821 821
  * @param string $selected Slug for the role that should be already selected.
822 822
  */
823
-function wp_dropdown_roles( $selected = '' ) {
823
+function wp_dropdown_roles($selected = '') {
824 824
 	$r = '';
825 825
 
826
-	$editable_roles = array_reverse( get_editable_roles() );
826
+	$editable_roles = array_reverse(get_editable_roles());
827 827
 
828
-	foreach ( $editable_roles as $role => $details ) {
829
-		$name = translate_user_role($details['name'] );
828
+	foreach ($editable_roles as $role => $details) {
829
+		$name = translate_user_role($details['name']);
830 830
 		// preselect specified role
831
-		if ( $selected == $role ) {
832
-			$r .= "\n\t<option selected='selected' value='" . esc_attr( $role ) . "'>$name</option>";
831
+		if ($selected == $role) {
832
+			$r .= "\n\t<option selected='selected' value='".esc_attr($role)."'>$name</option>";
833 833
 		} else {
834
-			$r .= "\n\t<option value='" . esc_attr( $role ) . "'>$name</option>";
834
+			$r .= "\n\t<option value='".esc_attr($role)."'>$name</option>";
835 835
 		}
836 836
 	}
837 837
 
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  *
846 846
  * @param string $action The action attribute for the form.
847 847
  */
848
-function wp_import_upload_form( $action ) {
848
+function wp_import_upload_form($action) {
849 849
 
850 850
 	/**
851 851
 	 * Filters the maximum allowed upload size for import files.
@@ -856,22 +856,22 @@  discard block
 block discarded – undo
856 856
 	 *
857 857
 	 * @param int $max_upload_size Allowed upload size. Default 1 MB.
858 858
 	 */
859
-	$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
860
-	$size = size_format( $bytes );
859
+	$bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
860
+	$size = size_format($bytes);
861 861
 	$upload_dir = wp_upload_dir();
862
-	if ( ! empty( $upload_dir['error'] ) ) :
862
+	if ( ! empty($upload_dir['error'])) :
863 863
 		?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
864 864
 		<p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
865 865
 	else :
866 866
 ?>
867
-<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
867
+<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url(wp_nonce_url($action, 'import-upload')); ?>">
868 868
 <p>
869
-<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
869
+<label for="upload"><?php _e('Choose a file from your computer:'); ?></label> (<?php printf(__('Maximum size: %s'), $size); ?>)
870 870
 <input type="file" id="upload" name="import" size="25" />
871 871
 <input type="hidden" name="action" value="save" />
872 872
 <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
873 873
 </p>
874
-<?php submit_button( __('Upload file and import'), 'primary' ); ?>
874
+<?php submit_button(__('Upload file and import'), 'primary'); ?>
875 875
 </form>
876 876
 <?php
877 877
 	endif;
@@ -905,75 +905,75 @@  discard block
 block discarded – undo
905 905
  *                                              of the box array (which is the second parameter passed
906 906
  *                                              to your callback). Default null.
907 907
  */
908
-function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
908
+function add_meta_box($id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null) {
909 909
 	global $wp_meta_boxes;
910 910
 
911
-	if ( empty( $screen ) ) {
911
+	if (empty($screen)) {
912 912
 		$screen = get_current_screen();
913
-	} elseif ( is_string( $screen ) ) {
914
-		$screen = convert_to_screen( $screen );
915
-	} elseif ( is_array( $screen ) ) {
916
-		foreach ( $screen as $single_screen ) {
917
-			add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args );
913
+	} elseif (is_string($screen)) {
914
+		$screen = convert_to_screen($screen);
915
+	} elseif (is_array($screen)) {
916
+		foreach ($screen as $single_screen) {
917
+			add_meta_box($id, $title, $callback, $single_screen, $context, $priority, $callback_args);
918 918
 		}
919 919
 	}
920 920
 
921
-	if ( ! isset( $screen->id ) ) {
921
+	if ( ! isset($screen->id)) {
922 922
 		return;
923 923
 	}
924 924
 
925 925
 	$page = $screen->id;
926 926
 
927
-	if ( !isset($wp_meta_boxes) )
927
+	if ( ! isset($wp_meta_boxes))
928 928
 		$wp_meta_boxes = array();
929
-	if ( !isset($wp_meta_boxes[$page]) )
929
+	if ( ! isset($wp_meta_boxes[$page]))
930 930
 		$wp_meta_boxes[$page] = array();
931
-	if ( !isset($wp_meta_boxes[$page][$context]) )
931
+	if ( ! isset($wp_meta_boxes[$page][$context]))
932 932
 		$wp_meta_boxes[$page][$context] = array();
933 933
 
934
-	foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
935
-		foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
936
-			if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
934
+	foreach (array_keys($wp_meta_boxes[$page]) as $a_context) {
935
+		foreach (array('high', 'core', 'default', 'low') as $a_priority) {
936
+			if ( ! isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]))
937 937
 				continue;
938 938
 
939 939
 			// If a core box was previously added or removed by a plugin, don't add.
940
-			if ( 'core' == $priority ) {
940
+			if ('core' == $priority) {
941 941
 				// If core box previously deleted, don't add
942
-				if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
942
+				if (false === $wp_meta_boxes[$page][$a_context][$a_priority][$id])
943 943
 					return;
944 944
 
945 945
 				/*
946 946
 				 * If box was added with default priority, give it core priority to
947 947
 				 * maintain sort order.
948 948
 				 */
949
-				if ( 'default' == $a_priority ) {
949
+				if ('default' == $a_priority) {
950 950
 					$wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
951 951
 					unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
952 952
 				}
953 953
 				return;
954 954
 			}
955 955
 			// If no priority given and id already present, use existing priority.
956
-			if ( empty($priority) ) {
956
+			if (empty($priority)) {
957 957
 				$priority = $a_priority;
958 958
 			/*
959 959
 			 * Else, if we're adding to the sorted priority, we don't know the title
960 960
 			 * or callback. Grab them from the previously added context/priority.
961 961
 			 */
962
-			} elseif ( 'sorted' == $priority ) {
962
+			} elseif ('sorted' == $priority) {
963 963
 				$title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
964 964
 				$callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
965 965
 				$callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
966 966
 			}
967 967
 			// An id can be in only one priority and one context.
968
-			if ( $priority != $a_priority || $context != $a_context )
968
+			if ($priority != $a_priority || $context != $a_context)
969 969
 				unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
970 970
 		}
971 971
 	}
972 972
 
973
-	if ( empty($priority) )
973
+	if (empty($priority))
974 974
 		$priority = 'low';
975 975
 
976
-	if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
976
+	if ( ! isset($wp_meta_boxes[$page][$context][$priority]))
977 977
 		$wp_meta_boxes[$page][$context][$priority] = array();
978 978
 
979 979
 	$wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args);
@@ -992,27 +992,27 @@  discard block
 block discarded – undo
992 992
  * @param mixed            $object  gets passed to the box callback function as first parameter
993 993
  * @return int number of meta_boxes
994 994
  */
995
-function do_meta_boxes( $screen, $context, $object ) {
995
+function do_meta_boxes($screen, $context, $object) {
996 996
 	global $wp_meta_boxes;
997 997
 	static $already_sorted = false;
998 998
 
999
-	if ( empty( $screen ) )
999
+	if (empty($screen))
1000 1000
 		$screen = get_current_screen();
1001
-	elseif ( is_string( $screen ) )
1002
-		$screen = convert_to_screen( $screen );
1001
+	elseif (is_string($screen))
1002
+		$screen = convert_to_screen($screen);
1003 1003
 
1004 1004
 	$page = $screen->id;
1005 1005
 
1006
-	$hidden = get_hidden_meta_boxes( $screen );
1006
+	$hidden = get_hidden_meta_boxes($screen);
1007 1007
 
1008 1008
 	printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
1009 1009
 
1010 1010
 	// Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
1011
-	if ( ! $already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
1012
-		foreach ( $sorted as $box_context => $ids ) {
1013
-			foreach ( explode( ',', $ids ) as $id ) {
1014
-				if ( $id && 'dashboard_browser_nag' !== $id ) {
1015
-					add_meta_box( $id, null, null, $screen, $box_context, 'sorted' );
1011
+	if ( ! $already_sorted && $sorted = get_user_option("meta-box-order_$page")) {
1012
+		foreach ($sorted as $box_context => $ids) {
1013
+			foreach (explode(',', $ids) as $id) {
1014
+				if ($id && 'dashboard_browser_nag' !== $id) {
1015
+					add_meta_box($id, null, null, $screen, $box_context, 'sorted');
1016 1016
 				}
1017 1017
 			}
1018 1018
 		}
@@ -1022,31 +1022,31 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
 	$i = 0;
1024 1024
 
1025
-	if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
1026
-		foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {
1027
-			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ]) ) {
1028
-				foreach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1029
-					if ( false == $box || ! $box['title'] )
1025
+	if (isset($wp_meta_boxes[$page][$context])) {
1026
+		foreach (array('high', 'sorted', 'core', 'default', 'low') as $priority) {
1027
+			if (isset($wp_meta_boxes[$page][$context][$priority])) {
1028
+				foreach ((array) $wp_meta_boxes[$page][$context][$priority] as $box) {
1029
+					if (false == $box || ! $box['title'])
1030 1030
 						continue;
1031 1031
 					$i++;
1032 1032
 					$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
1033
-					echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
1034
-					if ( 'dashboard_browser_nag' != $box['id'] ) {
1035
-						$widget_title = $box[ 'title' ];
1033
+					echo '<div id="'.$box['id'].'" class="postbox '.postbox_classes($box['id'], $page).$hidden_class.'" '.'>'."\n";
1034
+					if ('dashboard_browser_nag' != $box['id']) {
1035
+						$widget_title = $box['title'];
1036 1036
 
1037
-						if ( is_array( $box[ 'args' ] ) && isset( $box[ 'args' ][ '__widget_basename' ] ) ) {
1038
-							$widget_title = $box[ 'args' ][ '__widget_basename' ];
1037
+						if (is_array($box['args']) && isset($box['args']['__widget_basename'])) {
1038
+							$widget_title = $box['args']['__widget_basename'];
1039 1039
 							// Do not pass this parameter to the user callback function.
1040
-							unset( $box[ 'args' ][ '__widget_basename' ] );
1040
+							unset($box['args']['__widget_basename']);
1041 1041
 						}
1042 1042
 
1043 1043
 						echo '<button type="button" class="handlediv" aria-expanded="true">';
1044
-						echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $widget_title ) . '</span>';
1044
+						echo '<span class="screen-reader-text">'.sprintf(__('Toggle panel: %s'), $widget_title).'</span>';
1045 1045
 						echo '<span class="toggle-indicator" aria-hidden="true"></span>';
1046 1046
 						echo '</button>';
1047 1047
 					}
1048 1048
 					echo "<h2 class='hndle'><span>{$box['title']}</span></h2>\n";
1049
-					echo '<div class="inside">' . "\n";
1049
+					echo '<div class="inside">'."\n";
1050 1050
 					call_user_func($box['callback'], $object, $box);
1051 1051
 					echo "</div>\n";
1052 1052
 					echo "</div>\n";
@@ -1079,33 +1079,33 @@  discard block
 block discarded – undo
1079 1079
  *                                        include 'normal' and 'side'. Menus meta boxes (accordion sections)
1080 1080
  *                                        all use the 'side' context.
1081 1081
  */
1082
-function remove_meta_box( $id, $screen, $context ) {
1082
+function remove_meta_box($id, $screen, $context) {
1083 1083
 	global $wp_meta_boxes;
1084 1084
 
1085
-	if ( empty( $screen ) ) {
1085
+	if (empty($screen)) {
1086 1086
 		$screen = get_current_screen();
1087
-	} elseif ( is_string( $screen ) ) {
1088
-		$screen = convert_to_screen( $screen );
1089
-	} elseif ( is_array( $screen ) ) {
1090
-		foreach ( $screen as $single_screen ) {
1091
-			remove_meta_box( $id, $single_screen, $context );
1087
+	} elseif (is_string($screen)) {
1088
+		$screen = convert_to_screen($screen);
1089
+	} elseif (is_array($screen)) {
1090
+		foreach ($screen as $single_screen) {
1091
+			remove_meta_box($id, $single_screen, $context);
1092 1092
 		}
1093 1093
 	}
1094 1094
 
1095
-	if ( ! isset( $screen->id ) ) {
1095
+	if ( ! isset($screen->id)) {
1096 1096
 		return;
1097 1097
 	}
1098 1098
 
1099 1099
 	$page = $screen->id;
1100 1100
 
1101
-	if ( !isset($wp_meta_boxes) )
1101
+	if ( ! isset($wp_meta_boxes))
1102 1102
 		$wp_meta_boxes = array();
1103
-	if ( !isset($wp_meta_boxes[$page]) )
1103
+	if ( ! isset($wp_meta_boxes[$page]))
1104 1104
 		$wp_meta_boxes[$page] = array();
1105
-	if ( !isset($wp_meta_boxes[$page][$context]) )
1105
+	if ( ! isset($wp_meta_boxes[$page][$context]))
1106 1106
 		$wp_meta_boxes[$page][$context] = array();
1107 1107
 
1108
-	foreach ( array('high', 'core', 'default', 'low') as $priority )
1108
+	foreach (array('high', 'core', 'default', 'low') as $priority)
1109 1109
 		$wp_meta_boxes[$page][$context][$priority][$id] = false;
1110 1110
 }
1111 1111
 
@@ -1125,19 +1125,19 @@  discard block
 block discarded – undo
1125 1125
  * @param mixed         $object  gets passed to the section callback function as first parameter.
1126 1126
  * @return int number of meta boxes as accordion sections.
1127 1127
  */
1128
-function do_accordion_sections( $screen, $context, $object ) {
1128
+function do_accordion_sections($screen, $context, $object) {
1129 1129
 	global $wp_meta_boxes;
1130 1130
 
1131
-	wp_enqueue_script( 'accordion' );
1131
+	wp_enqueue_script('accordion');
1132 1132
 
1133
-	if ( empty( $screen ) )
1133
+	if (empty($screen))
1134 1134
 		$screen = get_current_screen();
1135
-	elseif ( is_string( $screen ) )
1136
-		$screen = convert_to_screen( $screen );
1135
+	elseif (is_string($screen))
1136
+		$screen = convert_to_screen($screen);
1137 1137
 
1138 1138
 	$page = $screen->id;
1139 1139
 
1140
-	$hidden = get_hidden_meta_boxes( $screen );
1140
+	$hidden = get_hidden_meta_boxes($screen);
1141 1141
 	?>
1142 1142
 	<div id="side-sortables" class="accordion-container">
1143 1143
 		<ul class="outer-border">
@@ -1145,29 +1145,29 @@  discard block
 block discarded – undo
1145 1145
 	$i = 0;
1146 1146
 	$first_open = false;
1147 1147
 
1148
-	if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
1149
-		foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
1150
-			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
1151
-				foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1152
-					if ( false == $box || ! $box['title'] )
1148
+	if (isset($wp_meta_boxes[$page][$context])) {
1149
+		foreach (array('high', 'core', 'default', 'low') as $priority) {
1150
+			if (isset($wp_meta_boxes[$page][$context][$priority])) {
1151
+				foreach ($wp_meta_boxes[$page][$context][$priority] as $box) {
1152
+					if (false == $box || ! $box['title'])
1153 1153
 						continue;
1154 1154
 					$i++;
1155
-					$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
1155
+					$hidden_class = in_array($box['id'], $hidden) ? 'hide-if-js' : '';
1156 1156
 
1157 1157
 					$open_class = '';
1158
-					if ( ! $first_open && empty( $hidden_class ) ) {
1158
+					if ( ! $first_open && empty($hidden_class)) {
1159 1159
 						$first_open = true;
1160 1160
 						$open_class = 'open';
1161 1161
 					}
1162 1162
 					?>
1163
-					<li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo $open_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>">
1163
+					<li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo $open_class; ?> <?php echo esc_attr($box['id']); ?>" id="<?php echo esc_attr($box['id']); ?>">
1164 1164
 						<h3 class="accordion-section-title hndle" tabindex="0">
1165
-							<?php echo esc_html( $box['title'] ); ?>
1166
-							<span class="screen-reader-text"><?php _e( 'Press return or enter to open this section' ); ?></span>
1165
+							<?php echo esc_html($box['title']); ?>
1166
+							<span class="screen-reader-text"><?php _e('Press return or enter to open this section'); ?></span>
1167 1167
 						</h3>
1168
-						<div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>">
1168
+						<div class="accordion-section-content <?php postbox_classes($box['id'], $page); ?>">
1169 1169
 							<div class="inside">
1170
-								<?php call_user_func( $box['callback'], $object, $box ); ?>
1170
+								<?php call_user_func($box['callback'], $object, $box); ?>
1171 1171
 							</div><!-- .inside -->
1172 1172
 						</div><!-- .accordion-section-content -->
1173 1173
 					</li><!-- .accordion-section -->
@@ -1208,20 +1208,20 @@  discard block
 block discarded – undo
1208 1208
 function add_settings_section($id, $title, $callback, $page) {
1209 1209
 	global $wp_settings_sections;
1210 1210
 
1211
-	if ( 'misc' == $page ) {
1212
-		_deprecated_argument( __FUNCTION__, '3.0.0',
1211
+	if ('misc' == $page) {
1212
+		_deprecated_argument(__FUNCTION__, '3.0.0',
1213 1213
 			/* translators: %s: misc */
1214
-			sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ),
1214
+			sprintf(__('The "%s" options group has been removed. Use another settings group.'),
1215 1215
 				'misc'
1216 1216
 			)
1217 1217
 		);
1218 1218
 		$page = 'general';
1219 1219
 	}
1220 1220
 
1221
-	if ( 'privacy' == $page ) {
1222
-		_deprecated_argument( __FUNCTION__, '3.5.0',
1221
+	if ('privacy' == $page) {
1222
+		_deprecated_argument(__FUNCTION__, '3.5.0',
1223 1223
 			/* translators: %s: privacy */
1224
-			sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ),
1224
+			sprintf(__('The "%s" options group has been removed. Use another settings group.'),
1225 1225
 				'privacy'
1226 1226
 			)
1227 1227
 		);
@@ -1269,20 +1269,20 @@  discard block
 block discarded – undo
1269 1269
 function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
1270 1270
 	global $wp_settings_fields;
1271 1271
 
1272
-	if ( 'misc' == $page ) {
1273
-		_deprecated_argument( __FUNCTION__, '3.0.0',
1272
+	if ('misc' == $page) {
1273
+		_deprecated_argument(__FUNCTION__, '3.0.0',
1274 1274
 			/* translators: %s: misc */
1275
-			sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ),
1275
+			sprintf(__('The "%s" options group has been removed. Use another settings group.'),
1276 1276
 				'misc'
1277 1277
 			)
1278 1278
 		);
1279 1279
 		$page = 'general';
1280 1280
 	}
1281 1281
 
1282
-	if ( 'privacy' == $page ) {
1283
-		_deprecated_argument( __FUNCTION__, '3.5.0',
1282
+	if ('privacy' == $page) {
1283
+		_deprecated_argument(__FUNCTION__, '3.5.0',
1284 1284
 			/* translators: %s: privacy */
1285
-			sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ),
1285
+			sprintf(__('The "%s" options group has been removed. Use another settings group.'),
1286 1286
 				'privacy'
1287 1287
 			)
1288 1288
 		);
@@ -1305,23 +1305,23 @@  discard block
 block discarded – undo
1305 1305
  *
1306 1306
  * @param string $page The slug name of the page whose settings sections you want to output
1307 1307
  */
1308
-function do_settings_sections( $page ) {
1308
+function do_settings_sections($page) {
1309 1309
 	global $wp_settings_sections, $wp_settings_fields;
1310 1310
 
1311
-	if ( ! isset( $wp_settings_sections[$page] ) )
1311
+	if ( ! isset($wp_settings_sections[$page]))
1312 1312
 		return;
1313 1313
 
1314
-	foreach ( (array) $wp_settings_sections[$page] as $section ) {
1315
-		if ( $section['title'] )
1314
+	foreach ((array) $wp_settings_sections[$page] as $section) {
1315
+		if ($section['title'])
1316 1316
 			echo "<h2>{$section['title']}</h2>\n";
1317 1317
 
1318
-		if ( $section['callback'] )
1319
-			call_user_func( $section['callback'], $section );
1318
+		if ($section['callback'])
1319
+			call_user_func($section['callback'], $section);
1320 1320
 
1321
-		if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
1321
+		if ( ! isset($wp_settings_fields) || ! isset($wp_settings_fields[$page]) || ! isset($wp_settings_fields[$page][$section['id']]))
1322 1322
 			continue;
1323 1323
 		echo '<table class="form-table">';
1324
-		do_settings_fields( $page, $section['id'] );
1324
+		do_settings_fields($page, $section['id']);
1325 1325
 		echo '</table>';
1326 1326
 	}
1327 1327
 }
@@ -1343,22 +1343,22 @@  discard block
 block discarded – undo
1343 1343
 function do_settings_fields($page, $section) {
1344 1344
 	global $wp_settings_fields;
1345 1345
 
1346
-	if ( ! isset( $wp_settings_fields[$page][$section] ) )
1346
+	if ( ! isset($wp_settings_fields[$page][$section]))
1347 1347
 		return;
1348 1348
 
1349
-	foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
1349
+	foreach ((array) $wp_settings_fields[$page][$section] as $field) {
1350 1350
 		$class = '';
1351 1351
 
1352
-		if ( ! empty( $field['args']['class'] ) ) {
1353
-			$class = ' class="' . esc_attr( $field['args']['class'] ) . '"';
1352
+		if ( ! empty($field['args']['class'])) {
1353
+			$class = ' class="'.esc_attr($field['args']['class']).'"';
1354 1354
 		}
1355 1355
 
1356 1356
 		echo "<tr{$class}>";
1357 1357
 
1358
-		if ( ! empty( $field['args']['label_for'] ) ) {
1359
-			echo '<th scope="row"><label for="' . esc_attr( $field['args']['label_for'] ) . '">' . $field['title'] . '</label></th>';
1358
+		if ( ! empty($field['args']['label_for'])) {
1359
+			echo '<th scope="row"><label for="'.esc_attr($field['args']['label_for']).'">'.$field['title'].'</label></th>';
1360 1360
 		} else {
1361
-			echo '<th scope="row">' . $field['title'] . '</th>';
1361
+			echo '<th scope="row">'.$field['title'].'</th>';
1362 1362
 		}
1363 1363
 
1364 1364
 		echo '<td>';
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
  * @param string $type    Optional. Message type, controls HTML class. Accepts 'error' or 'updated'.
1393 1393
  *                        Default 'error'.
1394 1394
  */
1395
-function add_settings_error( $setting, $code, $message, $type = 'error' ) {
1395
+function add_settings_error($setting, $code, $message, $type = 'error') {
1396 1396
 	global $wp_settings_errors;
1397 1397
 
1398 1398
 	$wp_settings_errors[] = array(
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
  * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
1427 1427
  * @return array Array of settings errors
1428 1428
  */
1429
-function get_settings_errors( $setting = '', $sanitize = false ) {
1429
+function get_settings_errors($setting = '', $sanitize = false) {
1430 1430
 	global $wp_settings_errors;
1431 1431
 
1432 1432
 	/*
@@ -1434,24 +1434,24 @@  discard block
 block discarded – undo
1434 1434
 	 * This allows the $sanitize_callback from register_setting() to run, adding
1435 1435
 	 * any settings errors you want to show by default.
1436 1436
 	 */
1437
-	if ( $sanitize )
1438
-		sanitize_option( $setting, get_option( $setting ) );
1437
+	if ($sanitize)
1438
+		sanitize_option($setting, get_option($setting));
1439 1439
 
1440 1440
 	// If settings were passed back from options.php then use them.
1441
-	if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {
1442
-		$wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) );
1443
-		delete_transient( 'settings_errors' );
1441
+	if (isset($_GET['settings-updated']) && $_GET['settings-updated'] && get_transient('settings_errors')) {
1442
+		$wp_settings_errors = array_merge((array) $wp_settings_errors, get_transient('settings_errors'));
1443
+		delete_transient('settings_errors');
1444 1444
 	}
1445 1445
 
1446 1446
 	// Check global in case errors have been added on this pageload.
1447
-	if ( ! count( $wp_settings_errors ) )
1447
+	if ( ! count($wp_settings_errors))
1448 1448
 		return array();
1449 1449
 
1450 1450
 	// Filter the results to those of a specific setting if one was set.
1451
-	if ( $setting ) {
1451
+	if ($setting) {
1452 1452
 		$setting_errors = array();
1453
-		foreach ( (array) $wp_settings_errors as $key => $details ) {
1454
-			if ( $setting == $details['setting'] )
1453
+		foreach ((array) $wp_settings_errors as $key => $details) {
1454
+			if ($setting == $details['setting'])
1455 1455
 				$setting_errors[] = $wp_settings_errors[$key];
1456 1456
 		}
1457 1457
 		return $setting_errors;
@@ -1487,20 +1487,20 @@  discard block
 block discarded – undo
1487 1487
  * @param bool   $hide_on_update If set to true errors will not be shown if the settings page has
1488 1488
  *                               already been submitted.
1489 1489
  */
1490
-function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
1490
+function settings_errors($setting = '', $sanitize = false, $hide_on_update = false) {
1491 1491
 
1492
-	if ( $hide_on_update && ! empty( $_GET['settings-updated'] ) )
1492
+	if ($hide_on_update && ! empty($_GET['settings-updated']))
1493 1493
 		return;
1494 1494
 
1495
-	$settings_errors = get_settings_errors( $setting, $sanitize );
1495
+	$settings_errors = get_settings_errors($setting, $sanitize);
1496 1496
 
1497
-	if ( empty( $settings_errors ) )
1497
+	if (empty($settings_errors))
1498 1498
 		return;
1499 1499
 
1500 1500
 	$output = '';
1501
-	foreach ( $settings_errors as $key => $details ) {
1502
-		$css_id = 'setting-error-' . $details['code'];
1503
-		$css_class = $details['type'] . ' settings-error notice is-dismissible';
1501
+	foreach ($settings_errors as $key => $details) {
1502
+		$css_id = 'setting-error-'.$details['code'];
1503
+		$css_class = $details['type'].' settings-error notice is-dismissible';
1504 1504
 		$output .= "<div id='$css_id' class='$css_class'> \n";
1505 1505
 		$output .= "<p><strong>{$details['message']}</strong></p>";
1506 1506
 		$output .= "</div> \n";
@@ -1519,26 +1519,26 @@  discard block
 block discarded – undo
1519 1519
 ?>
1520 1520
 	<div id="find-posts" class="find-box" style="display: none;">
1521 1521
 		<div id="find-posts-head" class="find-box-head">
1522
-			<?php _e( 'Attach to existing content' ); ?>
1523
-			<button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></span></button>
1522
+			<?php _e('Attach to existing content'); ?>
1523
+			<button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e('Close media attachment panel'); ?></span></button>
1524 1524
 		</div>
1525 1525
 		<div class="find-box-inside">
1526 1526
 			<div class="find-box-search">
1527
-				<?php if ( $found_action ) { ?>
1527
+				<?php if ($found_action) { ?>
1528 1528
 					<input type="hidden" name="found_action" value="<?php echo esc_attr($found_action); ?>" />
1529 1529
 				<?php } ?>
1530 1530
 				<input type="hidden" name="affected" id="affected" value="" />
1531
-				<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
1532
-				<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
1531
+				<?php wp_nonce_field('find-posts', '_ajax_nonce', false); ?>
1532
+				<label class="screen-reader-text" for="find-posts-input"><?php _e('Search'); ?></label>
1533 1533
 				<input type="text" id="find-posts-input" name="ps" value="" />
1534 1534
 				<span class="spinner"></span>
1535
-				<input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
1535
+				<input type="button" id="find-posts-search" value="<?php esc_attr_e('Search'); ?>" class="button" />
1536 1536
 				<div class="clear"></div>
1537 1537
 			</div>
1538 1538
 			<div id="find-posts-response"></div>
1539 1539
 		</div>
1540 1540
 		<div class="find-box-buttons">
1541
-			<?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?>
1541
+			<?php submit_button(__('Select'), 'primary alignright', 'find-posts-submit', false); ?>
1542 1542
 			<div class="clear"></div>
1543 1543
 		</div>
1544 1544
 	</div>
@@ -1554,8 +1554,8 @@  discard block
 block discarded – undo
1554 1554
  */
1555 1555
 function the_post_password() {
1556 1556
 	$post = get_post();
1557
-	if ( isset( $post->post_password ) )
1558
-		echo esc_attr( $post->post_password );
1557
+	if (isset($post->post_password))
1558
+		echo esc_attr($post->post_password);
1559 1559
 }
1560 1560
 
1561 1561
 /**
@@ -1569,11 +1569,11 @@  discard block
 block discarded – undo
1569 1569
  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
1570 1570
  * @return string The post title if set.
1571 1571
  */
1572
-function _draft_or_post_title( $post = 0 ) {
1573
-	$title = get_the_title( $post );
1574
-	if ( empty( $title ) )
1575
-		$title = __( '(no title)' );
1576
-	return esc_html( $title );
1572
+function _draft_or_post_title($post = 0) {
1573
+	$title = get_the_title($post);
1574
+	if (empty($title))
1575
+		$title = __('(no title)');
1576
+	return esc_html($title);
1577 1577
 }
1578 1578
 
1579 1579
 /**
@@ -1585,7 +1585,7 @@  discard block
 block discarded – undo
1585 1585
  * @since 2.7.0
1586 1586
  */
1587 1587
 function _admin_search_query() {
1588
-	echo isset($_REQUEST['s']) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
1588
+	echo isset($_REQUEST['s']) ? esc_attr(wp_unslash($_REQUEST['s'])) : '';
1589 1589
 }
1590 1590
 
1591 1591
 /**
@@ -1600,69 +1600,69 @@  discard block
 block discarded – undo
1600 1600
  * @param string $title      Optional. Title of the Iframe page. Default empty.
1601 1601
  * @param bool   $deprecated Not used.
1602 1602
  */
1603
-function iframe_header( $title = '', $deprecated = false ) {
1604
-	show_admin_bar( false );
1603
+function iframe_header($title = '', $deprecated = false) {
1604
+	show_admin_bar(false);
1605 1605
 	global $hook_suffix, $admin_body_class, $wp_locale;
1606 1606
 	$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
1607 1607
 
1608 1608
 	$current_screen = get_current_screen();
1609 1609
 
1610
-	@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
1610
+	@header('Content-Type: '.get_option('html_type').'; charset='.get_option('blog_charset'));
1611 1611
 	_wp_admin_html_begin();
1612 1612
 ?>
1613 1613
 <title><?php bloginfo('name') ?> &rsaquo; <?php echo $title ?> &#8212; <?php _e('WordPress'); ?></title>
1614 1614
 <?php
1615
-wp_enqueue_style( 'colors' );
1615
+wp_enqueue_style('colors');
1616 1616
 ?>
1617 1617
 <script type="text/javascript">
1618 1618
 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
1619 1619
 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
1620
-var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
1620
+var ajaxurl = '<?php echo admin_url('admin-ajax.php', 'relative'); ?>',
1621 1621
 	pagenow = '<?php echo $current_screen->id; ?>',
1622 1622
 	typenow = '<?php echo $current_screen->post_type; ?>',
1623 1623
 	adminpage = '<?php echo $admin_body_class; ?>',
1624
-	thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
1625
-	decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
1624
+	thousandsSeparator = '<?php echo addslashes($wp_locale->number_format['thousands_sep']); ?>',
1625
+	decimalPoint = '<?php echo addslashes($wp_locale->number_format['decimal_point']); ?>',
1626 1626
 	isRtl = <?php echo (int) is_rtl(); ?>;
1627 1627
 </script>
1628 1628
 <?php
1629 1629
 /** This action is documented in wp-admin/admin-header.php */
1630
-do_action( 'admin_enqueue_scripts', $hook_suffix );
1630
+do_action('admin_enqueue_scripts', $hook_suffix);
1631 1631
 
1632 1632
 /** This action is documented in wp-admin/admin-header.php */
1633
-do_action( "admin_print_styles-$hook_suffix" );
1633
+do_action("admin_print_styles-$hook_suffix");
1634 1634
 
1635 1635
 /** This action is documented in wp-admin/admin-header.php */
1636
-do_action( 'admin_print_styles' );
1636
+do_action('admin_print_styles');
1637 1637
 
1638 1638
 /** This action is documented in wp-admin/admin-header.php */
1639
-do_action( "admin_print_scripts-$hook_suffix" );
1639
+do_action("admin_print_scripts-$hook_suffix");
1640 1640
 
1641 1641
 /** This action is documented in wp-admin/admin-header.php */
1642
-do_action( 'admin_print_scripts' );
1642
+do_action('admin_print_scripts');
1643 1643
 
1644 1644
 /** This action is documented in wp-admin/admin-header.php */
1645
-do_action( "admin_head-$hook_suffix" );
1645
+do_action("admin_head-$hook_suffix");
1646 1646
 
1647 1647
 /** This action is documented in wp-admin/admin-header.php */
1648
-do_action( 'admin_head' );
1648
+do_action('admin_head');
1649 1649
 
1650
-$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
1650
+$admin_body_class .= ' locale-'.sanitize_html_class(strtolower(str_replace('_', '-', get_user_locale())));
1651 1651
 
1652
-if ( is_rtl() )
1652
+if (is_rtl())
1653 1653
 	$admin_body_class .= ' rtl';
1654 1654
 
1655 1655
 ?>
1656 1656
 </head>
1657 1657
 <?php
1658 1658
 /** This filter is documented in wp-admin/admin-header.php */
1659
-$admin_body_classes = apply_filters( 'admin_body_class', '' );
1659
+$admin_body_classes = apply_filters('admin_body_class', '');
1660 1660
 ?>
1661 1661
 <body<?php
1662 1662
 /**
1663 1663
  * @global string $body_id
1664 1664
  */
1665
-if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
1665
+if (isset($GLOBALS['body_id'])) echo ' id="'.$GLOBALS['body_id'].'"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes.' '.$admin_body_class; ?>">
1666 1666
 <script type="text/javascript">
1667 1667
 (function(){
1668 1668
 var c = document.body.className;
@@ -1693,13 +1693,13 @@  discard block
 block discarded – undo
1693 1693
 	<div class="hidden">
1694 1694
 <?php
1695 1695
 	/** This action is documented in wp-admin/admin-footer.php */
1696
-	do_action( 'admin_footer', $hook_suffix );
1696
+	do_action('admin_footer', $hook_suffix);
1697 1697
 
1698 1698
 	/** This action is documented in wp-admin/admin-footer.php */
1699
-	do_action( "admin_print_footer_scripts-$hook_suffix" );
1699
+	do_action("admin_print_footer_scripts-$hook_suffix");
1700 1700
 
1701 1701
 	/** This action is documented in wp-admin/admin-footer.php */
1702
-	do_action( 'admin_print_footer_scripts' );
1702
+	do_action('admin_print_footer_scripts');
1703 1703
 ?>
1704 1704
 	</div>
1705 1705
 <script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
@@ -1714,33 +1714,33 @@  discard block
 block discarded – undo
1714 1714
  */
1715 1715
 function _post_states($post) {
1716 1716
 	$post_states = array();
1717
-	if ( isset( $_REQUEST['post_status'] ) )
1717
+	if (isset($_REQUEST['post_status']))
1718 1718
 		$post_status = $_REQUEST['post_status'];
1719 1719
 	else
1720 1720
 		$post_status = '';
1721 1721
 
1722
-	if ( !empty($post->post_password) )
1722
+	if ( ! empty($post->post_password))
1723 1723
 		$post_states['protected'] = __('Password protected');
1724
-	if ( 'private' == $post->post_status && 'private' != $post_status )
1724
+	if ('private' == $post->post_status && 'private' != $post_status)
1725 1725
 		$post_states['private'] = __('Private');
1726
-	if ( 'draft' == $post->post_status && 'draft' != $post_status )
1726
+	if ('draft' == $post->post_status && 'draft' != $post_status)
1727 1727
 		$post_states['draft'] = __('Draft');
1728
-	if ( 'pending' == $post->post_status && 'pending' != $post_status )
1728
+	if ('pending' == $post->post_status && 'pending' != $post_status)
1729 1729
 		$post_states['pending'] = _x('Pending', 'post status');
1730
-	if ( is_sticky($post->ID) )
1730
+	if (is_sticky($post->ID))
1731 1731
 		$post_states['sticky'] = __('Sticky');
1732 1732
 
1733
-	if ( 'future' === $post->post_status ) {
1734
-		$post_states['scheduled'] = __( 'Scheduled' );
1733
+	if ('future' === $post->post_status) {
1734
+		$post_states['scheduled'] = __('Scheduled');
1735 1735
 	}
1736 1736
 
1737
-	if ( 'page' === get_option( 'show_on_front' ) ) {
1738
-		if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) {
1739
-			$post_states['page_on_front'] = __( 'Front Page' );
1737
+	if ('page' === get_option('show_on_front')) {
1738
+		if (intval(get_option('page_on_front')) === $post->ID) {
1739
+			$post_states['page_on_front'] = __('Front Page');
1740 1740
 		}
1741 1741
 
1742
-		if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {
1743
-			$post_states['page_for_posts'] = __( 'Posts Page' );
1742
+		if (intval(get_option('page_for_posts')) === $post->ID) {
1743
+			$post_states['page_for_posts'] = __('Posts Page');
1744 1744
 		}
1745 1745
 	}
1746 1746
 
@@ -1753,15 +1753,15 @@  discard block
 block discarded – undo
1753 1753
 	 * @param array   $post_states An array of post display states.
1754 1754
 	 * @param WP_Post $post        The current post object.
1755 1755
 	 */
1756
-	$post_states = apply_filters( 'display_post_states', $post_states, $post );
1756
+	$post_states = apply_filters('display_post_states', $post_states, $post);
1757 1757
 
1758
-	if ( ! empty($post_states) ) {
1758
+	if ( ! empty($post_states)) {
1759 1759
 		$state_count = count($post_states);
1760 1760
 		$i = 0;
1761 1761
 		echo ' &mdash; ';
1762
-		foreach ( $post_states as $state ) {
1762
+		foreach ($post_states as $state) {
1763 1763
 			++$i;
1764
-			( $i == $state_count ) ? $sep = '' : $sep = ', ';
1764
+			($i == $state_count) ? $sep = '' : $sep = ', ';
1765 1765
 			echo "<span class='post-state'>$state$sep</span>";
1766 1766
 		}
1767 1767
 	}
@@ -1772,53 +1772,53 @@  discard block
 block discarded – undo
1772 1772
  *
1773 1773
  * @param WP_Post $post
1774 1774
  */
1775
-function _media_states( $post ) {
1775
+function _media_states($post) {
1776 1776
 	$media_states = array();
1777 1777
 	$stylesheet = get_option('stylesheet');
1778 1778
 
1779
-	if ( current_theme_supports( 'custom-header') ) {
1780
-		$meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true );
1779
+	if (current_theme_supports('custom-header')) {
1780
+		$meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true);
1781 1781
 
1782
-		if ( is_random_header_image() ) {
1783
-			$header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_id' );
1782
+		if (is_random_header_image()) {
1783
+			$header_images = wp_list_pluck(get_uploaded_header_images(), 'attachment_id');
1784 1784
 
1785
-			if ( $meta_header == $stylesheet && in_array( $post->ID, $header_images ) ) {
1786
-				$media_states[] = __( 'Header Image' );
1785
+			if ($meta_header == $stylesheet && in_array($post->ID, $header_images)) {
1786
+				$media_states[] = __('Header Image');
1787 1787
 			}
1788 1788
 		} else {
1789 1789
 			$header_image = get_header_image();
1790 1790
 
1791 1791
 			// Display "Header Image" if the image was ever used as a header image
1792
-			if ( ! empty( $meta_header ) && $meta_header == $stylesheet && $header_image !== wp_get_attachment_url( $post->ID ) ) {
1793
-				$media_states[] = __( 'Header Image' );
1792
+			if ( ! empty($meta_header) && $meta_header == $stylesheet && $header_image !== wp_get_attachment_url($post->ID)) {
1793
+				$media_states[] = __('Header Image');
1794 1794
 			}
1795 1795
 
1796 1796
 			// Display "Current Header Image" if the image is currently the header image
1797
-			if ( $header_image && $header_image == wp_get_attachment_url( $post->ID ) ) {
1798
-				$media_states[] = __( 'Current Header Image' );
1797
+			if ($header_image && $header_image == wp_get_attachment_url($post->ID)) {
1798
+				$media_states[] = __('Current Header Image');
1799 1799
 			}
1800 1800
 		}
1801 1801
 	}
1802 1802
 
1803
-	if ( current_theme_supports( 'custom-background') ) {
1804
-		$meta_background = get_post_meta($post->ID, '_wp_attachment_is_custom_background', true );
1803
+	if (current_theme_supports('custom-background')) {
1804
+		$meta_background = get_post_meta($post->ID, '_wp_attachment_is_custom_background', true);
1805 1805
 
1806
-		if ( ! empty( $meta_background ) && $meta_background == $stylesheet ) {
1807
-			$media_states[] = __( 'Background Image' );
1806
+		if ( ! empty($meta_background) && $meta_background == $stylesheet) {
1807
+			$media_states[] = __('Background Image');
1808 1808
 
1809 1809
 			$background_image = get_background_image();
1810
-			if ( $background_image && $background_image == wp_get_attachment_url( $post->ID ) ) {
1811
-				$media_states[] = __( 'Current Background Image' );
1810
+			if ($background_image && $background_image == wp_get_attachment_url($post->ID)) {
1811
+				$media_states[] = __('Current Background Image');
1812 1812
 			}
1813 1813
 		}
1814 1814
 	}
1815 1815
 
1816
-	if ( $post->ID == get_option( 'site_icon' ) ) {
1817
-		$media_states[] = __( 'Site Icon' );
1816
+	if ($post->ID == get_option('site_icon')) {
1817
+		$media_states[] = __('Site Icon');
1818 1818
 	}
1819 1819
 
1820
-	if ( $post->ID == get_theme_mod( 'custom_logo' ) ) {
1821
-		$media_states[] = __( 'Logo' );
1820
+	if ($post->ID == get_theme_mod('custom_logo')) {
1821
+		$media_states[] = __('Logo');
1822 1822
 	}
1823 1823
 
1824 1824
 	/**
@@ -1831,15 +1831,15 @@  discard block
 block discarded – undo
1831 1831
 	 *                              'Background Image', 'Site Icon', 'Logo'.
1832 1832
 	 * @param WP_Post $post         The current attachment object.
1833 1833
 	 */
1834
-	$media_states = apply_filters( 'display_media_states', $media_states, $post );
1834
+	$media_states = apply_filters('display_media_states', $media_states, $post);
1835 1835
 
1836
-	if ( ! empty( $media_states ) ) {
1837
-		$state_count = count( $media_states );
1836
+	if ( ! empty($media_states)) {
1837
+		$state_count = count($media_states);
1838 1838
 		$i = 0;
1839 1839
 		echo ' &mdash; ';
1840
-		foreach ( $media_states as $state ) {
1840
+		foreach ($media_states as $state) {
1841 1841
 			++$i;
1842
-			( $i == $state_count ) ? $sep = '' : $sep = ', ';
1842
+			($i == $state_count) ? $sep = '' : $sep = ', ';
1843 1843
 			echo "<span class='post-state'>$state$sep</span>";
1844 1844
 		}
1845 1845
 	}
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
 function compression_test() {
1859 1859
 ?>
1860 1860
 	<script type="text/javascript">
1861
-	var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
1861
+	var compressionNonce = <?php echo wp_json_encode(wp_create_nonce('update_can_compress_scripts')); ?>;
1862 1862
 	var testCompression = {
1863 1863
 		get : function(test) {
1864 1864
 			var x;
@@ -1931,8 +1931,8 @@  discard block
 block discarded – undo
1931 1931
  *                                       as a string such as 'tabindex="1"', though the array format is
1932 1932
  *                                       preferred. Default null.
1933 1933
  */
1934
-function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {
1935
-	echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
1934
+function submit_button($text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null) {
1935
+	echo get_submit_button($text, $type, $name, $wrap, $other_attributes);
1936 1936
 }
1937 1937
 
1938 1938
 /**
@@ -1956,47 +1956,47 @@  discard block
 block discarded – undo
1956 1956
  *                                       Default empty.
1957 1957
  * @return string Submit button HTML.
1958 1958
  */
1959
-function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
1960
-	if ( ! is_array( $type ) )
1961
-		$type = explode( ' ', $type );
1962
-
1963
-	$button_shorthand = array( 'primary', 'small', 'large' );
1964
-	$classes = array( 'button' );
1965
-	foreach ( $type as $t ) {
1966
-		if ( 'secondary' === $t || 'button-secondary' === $t )
1959
+function get_submit_button($text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '') {
1960
+	if ( ! is_array($type))
1961
+		$type = explode(' ', $type);
1962
+
1963
+	$button_shorthand = array('primary', 'small', 'large');
1964
+	$classes = array('button');
1965
+	foreach ($type as $t) {
1966
+		if ('secondary' === $t || 'button-secondary' === $t)
1967 1967
 			continue;
1968
-		$classes[] = in_array( $t, $button_shorthand ) ? 'button-' . $t : $t;
1968
+		$classes[] = in_array($t, $button_shorthand) ? 'button-'.$t : $t;
1969 1969
 	}
1970 1970
 	// Remove empty items, remove duplicate items, and finally build a string.
1971
-	$class = implode( ' ', array_unique( array_filter( $classes ) ) );
1971
+	$class = implode(' ', array_unique(array_filter($classes)));
1972 1972
 
1973
-	$text = $text ? $text : __( 'Save Changes' );
1973
+	$text = $text ? $text : __('Save Changes');
1974 1974
 
1975 1975
 	// Default the id attribute to $name unless an id was specifically provided in $other_attributes
1976 1976
 	$id = $name;
1977
-	if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {
1977
+	if (is_array($other_attributes) && isset($other_attributes['id'])) {
1978 1978
 		$id = $other_attributes['id'];
1979
-		unset( $other_attributes['id'] );
1979
+		unset($other_attributes['id']);
1980 1980
 	}
1981 1981
 
1982 1982
 	$attributes = '';
1983
-	if ( is_array( $other_attributes ) ) {
1984
-		foreach ( $other_attributes as $attribute => $value ) {
1985
-			$attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important
1983
+	if (is_array($other_attributes)) {
1984
+		foreach ($other_attributes as $attribute => $value) {
1985
+			$attributes .= $attribute.'="'.esc_attr($value).'" '; // Trailing space is important
1986 1986
 		}
1987
-	} elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string
1987
+	} elseif ( ! empty($other_attributes)) { // Attributes provided as a string
1988 1988
 		$attributes = $other_attributes;
1989 1989
 	}
1990 1990
 
1991 1991
 	// Don't output empty name and id attributes.
1992
-	$name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : '';
1993
-	$id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : '';
1992
+	$name_attr = $name ? ' name="'.esc_attr($name).'"' : '';
1993
+	$id_attr = $id ? ' id="'.esc_attr($id).'"' : '';
1994 1994
 
1995
-	$button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class );
1996
-	$button	.= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
1995
+	$button = '<input type="submit"'.$name_attr.$id_attr.' class="'.esc_attr($class);
1996
+	$button	.= '" value="'.esc_attr($text).'" '.$attributes.' />';
1997 1997
 
1998
-	if ( $wrap ) {
1999
-		$button = '<p class="submit">' . $button . '</p>';
1998
+	if ($wrap) {
1999
+		$button = '<p class="submit">'.$button.'</p>';
2000 2000
 	}
2001 2001
 
2002 2002
 	return $button;
@@ -2009,9 +2009,9 @@  discard block
 block discarded – undo
2009 2009
 function _wp_admin_html_begin() {
2010 2010
 	global $is_IE;
2011 2011
 
2012
-	$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
2012
+	$admin_html_class = (is_admin_bar_showing()) ? 'wp-toolbar' : '';
2013 2013
 
2014
-	if ( $is_IE )
2014
+	if ($is_IE)
2015 2015
 		@header('X-UA-Compatible: IE=edge');
2016 2016
 
2017 2017
 ?>
@@ -2023,13 +2023,13 @@  discard block
 block discarded – undo
2023 2023
 	 *
2024 2024
 	 * @since 2.2.0
2025 2025
 	 */
2026
-	do_action( 'admin_xml_ns' );
2026
+	do_action('admin_xml_ns');
2027 2027
 ?> <?php language_attributes(); ?>>
2028 2028
 <![endif]-->
2029 2029
 <!--[if !(IE 8) ]><!-->
2030 2030
 <html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php
2031 2031
 	/** This action is documented in wp-admin/includes/template.php */
2032
-	do_action( 'admin_xml_ns' );
2032
+	do_action('admin_xml_ns');
2033 2033
 ?> <?php language_attributes(); ?>>
2034 2034
 <!--<![endif]-->
2035 2035
 <head>
@@ -2045,13 +2045,13 @@  discard block
 block discarded – undo
2045 2045
  * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen.
2046 2046
  * @return WP_Screen Screen object.
2047 2047
  */
2048
-function convert_to_screen( $hook_name ) {
2049
-	if ( ! class_exists( 'WP_Screen' ) ) {
2050
-		_doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3.0' );
2051
-		return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' );
2048
+function convert_to_screen($hook_name) {
2049
+	if ( ! class_exists('WP_Screen')) {
2050
+		_doing_it_wrong('convert_to_screen(), add_meta_box()', __("Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead."), '3.3.0');
2051
+		return (object) array('id' => '_invalid', 'base' => '_are_belong_to_us');
2052 2052
 	}
2053 2053
 
2054
-	return WP_Screen::get( $hook_name );
2054
+	return WP_Screen::get($hook_name);
2055 2055
 }
2056 2056
 
2057 2057
 /**
@@ -2064,11 +2064,11 @@  discard block
 block discarded – undo
2064 2064
 	?>
2065 2065
 	<div id="local-storage-notice" class="hidden notice is-dismissible">
2066 2066
 	<p class="local-restore">
2067
-		<?php _e( 'The backup of this post in your browser is different from the version below.' ); ?>
2067
+		<?php _e('The backup of this post in your browser is different from the version below.'); ?>
2068 2068
 		<button type="button" class="button restore-backup"><?php _e('Restore the backup'); ?></button>
2069 2069
 	</p>
2070 2070
 	<p class="help">
2071
-		<?php _e( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' ); ?>
2071
+		<?php _e('This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.'); ?>
2072 2072
 	</p>
2073 2073
 	</div>
2074 2074
 	<?php
@@ -2096,45 +2096,45 @@  discard block
 block discarded – undo
2096 2096
  *                          of echoing it. Default true.
2097 2097
  * }
2098 2098
  */
2099
-function wp_star_rating( $args = array() ) {
2099
+function wp_star_rating($args = array()) {
2100 2100
 	$defaults = array(
2101 2101
 		'rating' => 0,
2102 2102
 		'type'   => 'rating',
2103 2103
 		'number' => 0,
2104 2104
 		'echo'   => true,
2105 2105
 	);
2106
-	$r = wp_parse_args( $args, $defaults );
2106
+	$r = wp_parse_args($args, $defaults);
2107 2107
 
2108 2108
 	// Non-english decimal places when the $rating is coming from a string
2109
-	$rating = str_replace( ',', '.', $r['rating'] );
2109
+	$rating = str_replace(',', '.', $r['rating']);
2110 2110
 
2111 2111
 	// Convert Percentage to star rating, 0..5 in .5 increments
2112
-	if ( 'percent' == $r['type'] ) {
2113
-		$rating = round( $rating / 10, 0 ) / 2;
2112
+	if ('percent' == $r['type']) {
2113
+		$rating = round($rating / 10, 0) / 2;
2114 2114
 	}
2115 2115
 
2116 2116
 	// Calculate the number of each type of star needed
2117
-	$full_stars = floor( $rating );
2118
-	$half_stars = ceil( $rating - $full_stars );
2117
+	$full_stars = floor($rating);
2118
+	$half_stars = ceil($rating - $full_stars);
2119 2119
 	$empty_stars = 5 - $full_stars - $half_stars;
2120 2120
 
2121
-	if ( $r['number'] ) {
2121
+	if ($r['number']) {
2122 2122
 		/* translators: 1: The rating, 2: The number of ratings */
2123
-		$format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
2124
-		$title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
2123
+		$format = _n('%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number']);
2124
+		$title = sprintf($format, number_format_i18n($rating, 1), number_format_i18n($r['number']));
2125 2125
 	} else {
2126 2126
 		/* translators: 1: The rating */
2127
-		$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
2127
+		$title = sprintf(__('%s rating'), number_format_i18n($rating, 1));
2128 2128
 	}
2129 2129
 
2130 2130
 	$output = '<div class="star-rating">';
2131
-	$output .= '<span class="screen-reader-text">' . $title . '</span>';
2132
-	$output .= str_repeat( '<div class="star star-full" aria-hidden="true"></div>', $full_stars );
2133
-	$output .= str_repeat( '<div class="star star-half" aria-hidden="true"></div>', $half_stars );
2134
-	$output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
2131
+	$output .= '<span class="screen-reader-text">'.$title.'</span>';
2132
+	$output .= str_repeat('<div class="star star-full" aria-hidden="true"></div>', $full_stars);
2133
+	$output .= str_repeat('<div class="star star-half" aria-hidden="true"></div>', $half_stars);
2134
+	$output .= str_repeat('<div class="star star-empty" aria-hidden="true"></div>', $empty_stars);
2135 2135
 	$output .= '</div>';
2136 2136
 
2137
-	if ( $r['echo'] ) {
2137
+	if ($r['echo']) {
2138 2138
 		echo $output;
2139 2139
 	}
2140 2140
 
@@ -2148,5 +2148,5 @@  discard block
 block discarded – undo
2148 2148
  * @since 4.2.0
2149 2149
  */
2150 2150
 function _wp_posts_page_notice() {
2151
-	echo '<div class="notice notice-warning inline"><p>' . __( 'You are currently editing the page that shows your latest posts.' ) . '</p></div>';
2151
+	echo '<div class="notice notice-warning inline"><p>'.__('You are currently editing the page that shows your latest posts.').'</p></div>';
2152 2152
 }
Please login to merge, or discard this patch.
Braces   +189 added lines, -122 removed lines patch added patch discarded remove patch
@@ -191,10 +191,11 @@  discard block
 block discarded – undo
191 191
 function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
192 192
 	$post = get_post();
193 193
 
194
-	if ( $post && $post->ID )
195
-		$checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids'));
196
-	else
197
-		$checked_terms = array();
194
+	if ( $post && $post->ID ) {
195
+			$checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids'));
196
+	} else {
197
+			$checked_terms = array();
198
+	}
198 199
 
199 200
 	$terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
200 201
 
@@ -203,8 +204,10 @@  discard block
 block discarded – undo
203 204
 	$popular_ids = array();
204 205
 	foreach ( (array) $terms as $term ) {
205 206
 		$popular_ids[] = $term->term_id;
206
-		if ( !$echo ) // Hack for Ajax use.
207
+		if ( !$echo ) {
208
+			// Hack for Ajax use.
207 209
 			continue;
210
+		}
208 211
 		$id = "popular-$taxonomy-$term->term_id";
209 212
 		$checked = in_array( $term->term_id, $checked_terms ) ? 'checked="checked"' : '';
210 213
 		?>
@@ -248,8 +251,9 @@  discard block
 block discarded – undo
248 251
 
249 252
 	$categories = get_terms( 'link_category', array( 'orderby' => 'name', 'hide_empty' => 0 ) );
250 253
 
251
-	if ( empty( $categories ) )
252
-		return;
254
+	if ( empty( $categories ) ) {
255
+			return;
256
+	}
253 257
 
254 258
 	foreach ( $categories as $category ) {
255 259
 		$cat_id = $category->term_id;
@@ -270,8 +274,9 @@  discard block
 block discarded – undo
270 274
  */
271 275
 function get_inline_data($post) {
272 276
 	$post_type_object = get_post_type_object($post->post_type);
273
-	if ( ! current_user_can( 'edit_post', $post->ID ) )
274
-		return;
277
+	if ( ! current_user_can( 'edit_post', $post->ID ) ) {
278
+			return;
279
+	}
275 280
 
276 281
 	$title = esc_textarea( trim( $post->post_title ) );
277 282
 
@@ -331,11 +336,13 @@  discard block
 block discarded – undo
331 336
 		}
332 337
 	}
333 338
 
334
-	if ( !$post_type_object->hierarchical )
335
-		echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
339
+	if ( !$post_type_object->hierarchical ) {
340
+			echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
341
+	}
336 342
 
337
-	if ( post_type_supports( $post->post_type, 'post-formats' ) )
338
-		echo '<div class="post_format">' . esc_html( get_post_format( $post->ID ) ) . '</div>';
343
+	if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
344
+			echo '<div class="post_format">' . esc_html( get_post_format( $post->ID ) ) . '</div>';
345
+	}
339 346
 
340 347
 	echo '</div>';
341 348
 }
@@ -388,9 +395,12 @@  discard block
 block discarded – undo
388 395
 <form method="get">
389 396
 <?php if ( $table_row ) : ?>
390 397
 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
391
-<?php else : ?>
398
+<?php else {
399
+	: ?>
392 400
 <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
393
-<?php endif; ?>
401
+<?php endif;
402
+}
403
+?>
394 404
 	<fieldset class="comment-reply">
395 405
 	<legend>
396 406
 		<span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span>
@@ -442,15 +452,19 @@  discard block
 block discarded – undo
442 452
 	<input type="hidden" name="mode" id="mode" value="<?php echo esc_attr($mode); ?>" />
443 453
 	<?php
444 454
 		wp_nonce_field( 'replyto-comment', '_ajax_nonce-replyto-comment', false );
445
-		if ( current_user_can( 'unfiltered_html' ) )
446
-			wp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );
455
+		if ( current_user_can( 'unfiltered_html' ) ) {
456
+					wp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );
457
+		}
447 458
 	?>
448 459
 	</fieldset>
449 460
 <?php if ( $table_row ) : ?>
450 461
 </td></tr></tbody></table>
451
-<?php else : ?>
462
+<?php else {
463
+	: ?>
452 464
 </div></div>
453
-<?php endif; ?>
465
+<?php endif;
466
+}
467
+?>
454 468
 </form>
455 469
 <?php
456 470
 }
@@ -506,9 +520,10 @@  discard block
 block discarded – undo
506 520
 	</thead>
507 521
 	<tbody id='the-list' data-wp-lists='list:meta'>
508 522
 <?php
509
-	foreach ( $meta as $entry )
510
-		echo _list_meta_row( $entry, $count );
511
-?>
523
+	foreach ( $meta as $entry ) {
524
+			echo _list_meta_row( $entry, $count );
525
+	}
526
+	?>
512 527
 	</tbody>
513 528
 </table>
514 529
 <?php
@@ -528,11 +543,13 @@  discard block
 block discarded – undo
528 543
 function _list_meta_row( $entry, &$count ) {
529 544
 	static $update_nonce = '';
530 545
 
531
-	if ( is_protected_meta( $entry['meta_key'], 'post' ) )
532
-		return '';
546
+	if ( is_protected_meta( $entry['meta_key'], 'post' ) ) {
547
+			return '';
548
+	}
533 549
 
534
-	if ( ! $update_nonce )
535
-		$update_nonce = wp_create_nonce( 'add-meta' );
550
+	if ( ! $update_nonce ) {
551
+			$update_nonce = wp_create_nonce( 'add-meta' );
552
+	}
536 553
 
537 554
 	$r = '';
538 555
 	++ $count;
@@ -639,8 +656,9 @@  discard block
 block discarded – undo
639 656
 <?php
640 657
 
641 658
 	foreach ( $keys as $key ) {
642
-		if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) )
643
-			continue;
659
+		if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {
660
+					continue;
661
+		}
644 662
 		echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>";
645 663
 	}
646 664
 ?>
@@ -686,12 +704,14 @@  discard block
 block discarded – undo
686 704
 	global $wp_locale;
687 705
 	$post = get_post();
688 706
 
689
-	if ( $for_post )
690
-		$edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
707
+	if ( $for_post ) {
708
+			$edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
709
+	}
691 710
 
692 711
 	$tab_index_attribute = '';
693
-	if ( (int) $tab_index > 0 )
694
-		$tab_index_attribute = " tabindex=\"$tab_index\"";
712
+	if ( (int) $tab_index > 0 ) {
713
+			$tab_index_attribute = " tabindex=\"$tab_index\"";
714
+	}
695 715
 
696 716
 	// todo: Remove this?
697 717
 	// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
@@ -732,7 +752,9 @@  discard block
 block discarded – undo
732 752
 
733 753
 	echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
734 754
 
735
-	if ( $multi ) return;
755
+	if ( $multi ) {
756
+		return;
757
+	}
736 758
 
737 759
 	echo "\n\n";
738 760
 	$map = array(
@@ -799,8 +821,9 @@  discard block
 block discarded – undo
799 821
 	if ( $items ) {
800 822
 		foreach ( $items as $item ) {
801 823
 			// A page cannot be its own parent.
802
-			if ( $post && $post->ID && $item->ID == $post->ID )
803
-				continue;
824
+			if ( $post && $post->ID && $item->ID == $post->ID ) {
825
+							continue;
826
+			}
804 827
 
805 828
 			$pad = str_repeat( '&nbsp;', $level * 3 );
806 829
 			$selected = selected( $default, $item->ID, false );
@@ -862,9 +885,12 @@  discard block
 block discarded – undo
862 885
 	if ( ! empty( $upload_dir['error'] ) ) :
863 886
 		?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
864 887
 		<p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
865
-	else :
888
+	else {
889
+		:
866 890
 ?>
867
-<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
891
+<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) );
892
+	}
893
+	?>">
868 894
 <p>
869 895
 <label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
870 896
 <input type="file" id="upload" name="import" size="25" />
@@ -924,23 +950,28 @@  discard block
 block discarded – undo
924 950
 
925 951
 	$page = $screen->id;
926 952
 
927
-	if ( !isset($wp_meta_boxes) )
928
-		$wp_meta_boxes = array();
929
-	if ( !isset($wp_meta_boxes[$page]) )
930
-		$wp_meta_boxes[$page] = array();
931
-	if ( !isset($wp_meta_boxes[$page][$context]) )
932
-		$wp_meta_boxes[$page][$context] = array();
953
+	if ( !isset($wp_meta_boxes) ) {
954
+			$wp_meta_boxes = array();
955
+	}
956
+	if ( !isset($wp_meta_boxes[$page]) ) {
957
+			$wp_meta_boxes[$page] = array();
958
+	}
959
+	if ( !isset($wp_meta_boxes[$page][$context]) ) {
960
+			$wp_meta_boxes[$page][$context] = array();
961
+	}
933 962
 
934 963
 	foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
935 964
 		foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
936
-			if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
937
-				continue;
965
+			if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) {
966
+							continue;
967
+			}
938 968
 
939 969
 			// If a core box was previously added or removed by a plugin, don't add.
940 970
 			if ( 'core' == $priority ) {
941 971
 				// If core box previously deleted, don't add
942
-				if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
943
-					return;
972
+				if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) {
973
+									return;
974
+				}
944 975
 
945 976
 				/*
946 977
 				 * If box was added with default priority, give it core priority to
@@ -965,16 +996,19 @@  discard block
 block discarded – undo
965 996
 				$callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
966 997
 			}
967 998
 			// An id can be in only one priority and one context.
968
-			if ( $priority != $a_priority || $context != $a_context )
969
-				unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
999
+			if ( $priority != $a_priority || $context != $a_context ) {
1000
+							unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
1001
+			}
970 1002
 		}
971 1003
 	}
972 1004
 
973
-	if ( empty($priority) )
974
-		$priority = 'low';
1005
+	if ( empty($priority) ) {
1006
+			$priority = 'low';
1007
+	}
975 1008
 
976
-	if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
977
-		$wp_meta_boxes[$page][$context][$priority] = array();
1009
+	if ( !isset($wp_meta_boxes[$page][$context][$priority]) ) {
1010
+			$wp_meta_boxes[$page][$context][$priority] = array();
1011
+	}
978 1012
 
979 1013
 	$wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args);
980 1014
 }
@@ -996,10 +1030,11 @@  discard block
 block discarded – undo
996 1030
 	global $wp_meta_boxes;
997 1031
 	static $already_sorted = false;
998 1032
 
999
-	if ( empty( $screen ) )
1000
-		$screen = get_current_screen();
1001
-	elseif ( is_string( $screen ) )
1002
-		$screen = convert_to_screen( $screen );
1033
+	if ( empty( $screen ) ) {
1034
+			$screen = get_current_screen();
1035
+	} elseif ( is_string( $screen ) ) {
1036
+			$screen = convert_to_screen( $screen );
1037
+	}
1003 1038
 
1004 1039
 	$page = $screen->id;
1005 1040
 
@@ -1026,8 +1061,9 @@  discard block
 block discarded – undo
1026 1061
 		foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {
1027 1062
 			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ]) ) {
1028 1063
 				foreach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1029
-					if ( false == $box || ! $box['title'] )
1030
-						continue;
1064
+					if ( false == $box || ! $box['title'] ) {
1065
+											continue;
1066
+					}
1031 1067
 					$i++;
1032 1068
 					$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
1033 1069
 					echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
@@ -1098,16 +1134,20 @@  discard block
 block discarded – undo
1098 1134
 
1099 1135
 	$page = $screen->id;
1100 1136
 
1101
-	if ( !isset($wp_meta_boxes) )
1102
-		$wp_meta_boxes = array();
1103
-	if ( !isset($wp_meta_boxes[$page]) )
1104
-		$wp_meta_boxes[$page] = array();
1105
-	if ( !isset($wp_meta_boxes[$page][$context]) )
1106
-		$wp_meta_boxes[$page][$context] = array();
1137
+	if ( !isset($wp_meta_boxes) ) {
1138
+			$wp_meta_boxes = array();
1139
+	}
1140
+	if ( !isset($wp_meta_boxes[$page]) ) {
1141
+			$wp_meta_boxes[$page] = array();
1142
+	}
1143
+	if ( !isset($wp_meta_boxes[$page][$context]) ) {
1144
+			$wp_meta_boxes[$page][$context] = array();
1145
+	}
1107 1146
 
1108
-	foreach ( array('high', 'core', 'default', 'low') as $priority )
1109
-		$wp_meta_boxes[$page][$context][$priority][$id] = false;
1110
-}
1147
+	foreach ( array('high', 'core', 'default', 'low') as $priority ) {
1148
+			$wp_meta_boxes[$page][$context][$priority][$id] = false;
1149
+	}
1150
+	}
1111 1151
 
1112 1152
 /**
1113 1153
  * Meta Box Accordion Template Function
@@ -1130,10 +1170,11 @@  discard block
 block discarded – undo
1130 1170
 
1131 1171
 	wp_enqueue_script( 'accordion' );
1132 1172
 
1133
-	if ( empty( $screen ) )
1134
-		$screen = get_current_screen();
1135
-	elseif ( is_string( $screen ) )
1136
-		$screen = convert_to_screen( $screen );
1173
+	if ( empty( $screen ) ) {
1174
+			$screen = get_current_screen();
1175
+	} elseif ( is_string( $screen ) ) {
1176
+			$screen = convert_to_screen( $screen );
1177
+	}
1137 1178
 
1138 1179
 	$page = $screen->id;
1139 1180
 
@@ -1149,8 +1190,9 @@  discard block
 block discarded – undo
1149 1190
 		foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
1150 1191
 			if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
1151 1192
 				foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1152
-					if ( false == $box || ! $box['title'] )
1153
-						continue;
1193
+					if ( false == $box || ! $box['title'] ) {
1194
+											continue;
1195
+					}
1154 1196
 					$i++;
1155 1197
 					$hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
1156 1198
 
@@ -1308,18 +1350,22 @@  discard block
 block discarded – undo
1308 1350
 function do_settings_sections( $page ) {
1309 1351
 	global $wp_settings_sections, $wp_settings_fields;
1310 1352
 
1311
-	if ( ! isset( $wp_settings_sections[$page] ) )
1312
-		return;
1353
+	if ( ! isset( $wp_settings_sections[$page] ) ) {
1354
+			return;
1355
+	}
1313 1356
 
1314 1357
 	foreach ( (array) $wp_settings_sections[$page] as $section ) {
1315
-		if ( $section['title'] )
1316
-			echo "<h2>{$section['title']}</h2>\n";
1358
+		if ( $section['title'] ) {
1359
+					echo "<h2>{$section['title']}</h2>\n";
1360
+		}
1317 1361
 
1318
-		if ( $section['callback'] )
1319
-			call_user_func( $section['callback'], $section );
1362
+		if ( $section['callback'] ) {
1363
+					call_user_func( $section['callback'], $section );
1364
+		}
1320 1365
 
1321
-		if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
1322
-			continue;
1366
+		if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) ) {
1367
+					continue;
1368
+		}
1323 1369
 		echo '<table class="form-table">';
1324 1370
 		do_settings_fields( $page, $section['id'] );
1325 1371
 		echo '</table>';
@@ -1343,8 +1389,9 @@  discard block
 block discarded – undo
1343 1389
 function do_settings_fields($page, $section) {
1344 1390
 	global $wp_settings_fields;
1345 1391
 
1346
-	if ( ! isset( $wp_settings_fields[$page][$section] ) )
1347
-		return;
1392
+	if ( ! isset( $wp_settings_fields[$page][$section] ) ) {
1393
+			return;
1394
+	}
1348 1395
 
1349 1396
 	foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
1350 1397
 		$class = '';
@@ -1434,8 +1481,9 @@  discard block
 block discarded – undo
1434 1481
 	 * This allows the $sanitize_callback from register_setting() to run, adding
1435 1482
 	 * any settings errors you want to show by default.
1436 1483
 	 */
1437
-	if ( $sanitize )
1438
-		sanitize_option( $setting, get_option( $setting ) );
1484
+	if ( $sanitize ) {
1485
+			sanitize_option( $setting, get_option( $setting ) );
1486
+	}
1439 1487
 
1440 1488
 	// If settings were passed back from options.php then use them.
1441 1489
 	if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {
@@ -1444,15 +1492,17 @@  discard block
 block discarded – undo
1444 1492
 	}
1445 1493
 
1446 1494
 	// Check global in case errors have been added on this pageload.
1447
-	if ( ! count( $wp_settings_errors ) )
1448
-		return array();
1495
+	if ( ! count( $wp_settings_errors ) ) {
1496
+			return array();
1497
+	}
1449 1498
 
1450 1499
 	// Filter the results to those of a specific setting if one was set.
1451 1500
 	if ( $setting ) {
1452 1501
 		$setting_errors = array();
1453 1502
 		foreach ( (array) $wp_settings_errors as $key => $details ) {
1454
-			if ( $setting == $details['setting'] )
1455
-				$setting_errors[] = $wp_settings_errors[$key];
1503
+			if ( $setting == $details['setting'] ) {
1504
+							$setting_errors[] = $wp_settings_errors[$key];
1505
+			}
1456 1506
 		}
1457 1507
 		return $setting_errors;
1458 1508
 	}
@@ -1489,13 +1539,15 @@  discard block
 block discarded – undo
1489 1539
  */
1490 1540
 function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
1491 1541
 
1492
-	if ( $hide_on_update && ! empty( $_GET['settings-updated'] ) )
1493
-		return;
1542
+	if ( $hide_on_update && ! empty( $_GET['settings-updated'] ) ) {
1543
+			return;
1544
+	}
1494 1545
 
1495 1546
 	$settings_errors = get_settings_errors( $setting, $sanitize );
1496 1547
 
1497
-	if ( empty( $settings_errors ) )
1498
-		return;
1548
+	if ( empty( $settings_errors ) ) {
1549
+			return;
1550
+	}
1499 1551
 
1500 1552
 	$output = '';
1501 1553
 	foreach ( $settings_errors as $key => $details ) {
@@ -1554,9 +1606,10 @@  discard block
 block discarded – undo
1554 1606
  */
1555 1607
 function the_post_password() {
1556 1608
 	$post = get_post();
1557
-	if ( isset( $post->post_password ) )
1558
-		echo esc_attr( $post->post_password );
1559
-}
1609
+	if ( isset( $post->post_password ) ) {
1610
+			echo esc_attr( $post->post_password );
1611
+	}
1612
+	}
1560 1613
 
1561 1614
 /**
1562 1615
  * Get the post title.
@@ -1571,8 +1624,9 @@  discard block
 block discarded – undo
1571 1624
  */
1572 1625
 function _draft_or_post_title( $post = 0 ) {
1573 1626
 	$title = get_the_title( $post );
1574
-	if ( empty( $title ) )
1575
-		$title = __( '(no title)' );
1627
+	if ( empty( $title ) ) {
1628
+			$title = __( '(no title)' );
1629
+	}
1576 1630
 	return esc_html( $title );
1577 1631
 }
1578 1632
 
@@ -1649,8 +1703,9 @@  discard block
 block discarded – undo
1649 1703
 
1650 1704
 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
1651 1705
 
1652
-if ( is_rtl() )
1706
+if ( is_rtl() ) {
1653 1707
 	$admin_body_class .= ' rtl';
1708
+}
1654 1709
 
1655 1710
 ?>
1656 1711
 </head>
@@ -1662,7 +1717,10 @@  discard block
 block discarded – undo
1662 1717
 /**
1663 1718
  * @global string $body_id
1664 1719
  */
1665
-if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
1720
+if ( isset($GLOBALS['body_id']) ) {
1721
+	echo ' id="' . $GLOBALS['body_id'] . '"';
1722
+}
1723
+?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
1666 1724
 <script type="text/javascript">
1667 1725
 (function(){
1668 1726
 var c = document.body.className;
@@ -1714,21 +1772,27 @@  discard block
 block discarded – undo
1714 1772
  */
1715 1773
 function _post_states($post) {
1716 1774
 	$post_states = array();
1717
-	if ( isset( $_REQUEST['post_status'] ) )
1718
-		$post_status = $_REQUEST['post_status'];
1719
-	else
1720
-		$post_status = '';
1721
-
1722
-	if ( !empty($post->post_password) )
1723
-		$post_states['protected'] = __('Password protected');
1724
-	if ( 'private' == $post->post_status && 'private' != $post_status )
1725
-		$post_states['private'] = __('Private');
1726
-	if ( 'draft' == $post->post_status && 'draft' != $post_status )
1727
-		$post_states['draft'] = __('Draft');
1728
-	if ( 'pending' == $post->post_status && 'pending' != $post_status )
1729
-		$post_states['pending'] = _x('Pending', 'post status');
1730
-	if ( is_sticky($post->ID) )
1731
-		$post_states['sticky'] = __('Sticky');
1775
+	if ( isset( $_REQUEST['post_status'] ) ) {
1776
+			$post_status = $_REQUEST['post_status'];
1777
+	} else {
1778
+			$post_status = '';
1779
+	}
1780
+
1781
+	if ( !empty($post->post_password) ) {
1782
+			$post_states['protected'] = __('Password protected');
1783
+	}
1784
+	if ( 'private' == $post->post_status && 'private' != $post_status ) {
1785
+			$post_states['private'] = __('Private');
1786
+	}
1787
+	if ( 'draft' == $post->post_status && 'draft' != $post_status ) {
1788
+			$post_states['draft'] = __('Draft');
1789
+	}
1790
+	if ( 'pending' == $post->post_status && 'pending' != $post_status ) {
1791
+			$post_states['pending'] = _x('Pending', 'post status');
1792
+	}
1793
+	if ( is_sticky($post->ID) ) {
1794
+			$post_states['sticky'] = __('Sticky');
1795
+	}
1732 1796
 
1733 1797
 	if ( 'future' === $post->post_status ) {
1734 1798
 		$post_states['scheduled'] = __( 'Scheduled' );
@@ -1957,14 +2021,16 @@  discard block
 block discarded – undo
1957 2021
  * @return string Submit button HTML.
1958 2022
  */
1959 2023
 function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
1960
-	if ( ! is_array( $type ) )
1961
-		$type = explode( ' ', $type );
2024
+	if ( ! is_array( $type ) ) {
2025
+			$type = explode( ' ', $type );
2026
+	}
1962 2027
 
1963 2028
 	$button_shorthand = array( 'primary', 'small', 'large' );
1964 2029
 	$classes = array( 'button' );
1965 2030
 	foreach ( $type as $t ) {
1966
-		if ( 'secondary' === $t || 'button-secondary' === $t )
1967
-			continue;
2031
+		if ( 'secondary' === $t || 'button-secondary' === $t ) {
2032
+					continue;
2033
+		}
1968 2034
 		$classes[] = in_array( $t, $button_shorthand ) ? 'button-' . $t : $t;
1969 2035
 	}
1970 2036
 	// Remove empty items, remove duplicate items, and finally build a string.
@@ -2011,8 +2077,9 @@  discard block
 block discarded – undo
2011 2077
 
2012 2078
 	$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
2013 2079
 
2014
-	if ( $is_IE )
2015
-		@header('X-UA-Compatible: IE=edge');
2080
+	if ( $is_IE ) {
2081
+			@header('X-UA-Compatible: IE=edge');
2082
+	}
2016 2083
 
2017 2084
 ?>
2018 2085
 <!DOCTYPE html>
Please login to merge, or discard this patch.
src/wp-includes/comment-template.php 4 patches
Doc Comments   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @since 1.5.0
18 18
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
19 19
  *
20
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.
20
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.
21 21
  *									 Default current comment.
22 22
  * @return string The comment author
23 23
  */
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  * @since 0.71
53 53
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
54 54
  *
55
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
55
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
56 56
  *									 Default current comment.
57 57
  */
58 58
 function comment_author( $comment_ID = 0 ) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  * @since 1.5.0
78 78
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
79 79
  *
80
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.
80
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.
81 81
  *									 Default current comment.
82 82
  * @return string The current comment author's email
83 83
  */
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
  * @since 0.71
110 110
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
111 111
  *
112
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
112
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
113 113
  *									 Default current comment.
114 114
  */
115 115
 function comment_author_email( $comment_ID = 0 ) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
  * @since 1.5.0
210 210
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
211 211
  *
212
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.
212
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.
213 213
  *									 Default current comment.
214 214
  * @return string The comment author name or HTML link for author's URL.
215 215
  */
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
  * @since 0.71
244 244
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
245 245
  *
246
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
246
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
247 247
  *									 Default current comment.
248 248
  */
249 249
 function comment_author_link( $comment_ID = 0 ) {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
  * @since 1.5.0
257 257
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
258 258
  *
259
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address.
259
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address.
260 260
  *									 Default current comment.
261 261
  * @return string Comment author's IP address.
262 262
  */
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
  * @since 0.71
283 283
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
284 284
  *
285
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
285
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
286 286
  *									 Default current comment.
287 287
  */
288 288
 function comment_author_IP( $comment_ID = 0 ) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
  * @since 1.5.0
296 296
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
297 297
  *
298
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.
298
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.
299 299
  *									 Default current comment.
300 300
  * @return string Comment author URL.
301 301
  */
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
  * @since 0.71
329 329
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
330 330
  *
331
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
331
+ * @param integer $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
332 332
  *									 Default current comment.
333 333
  */
334 334
 function comment_author_url( $comment_ID = 0 ) {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
  *                                 Default empty.
367 367
  * @param string         $after    Optional. The text or HTML to display after the email link.
368 368
  *                                 Default empty.
369
- * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.
369
+ * @param integer $comment  Optional. Comment ID or WP_Comment object.
370 370
  *                                 Default is the current comment.
371 371
  * @return string The HTML link between the $before and $after parameters.
372 372
  */
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
  *                                 Default empty.
405 405
  * @param string         $after    Optional. Text or HTML to display after the email link.
406 406
  *                                 Default empty.
407
- * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.
407
+ * @param integer $comment  Optional. Comment ID or WP_Comment object.
408 408
  *                                 Default is the current comment.
409 409
  */
410 410
 function comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
533 533
  *
534 534
  * @param string          $d          Optional. The format of the date. Default user's setting.
535
- * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to get the date.
535
+ * @param integer  $comment_ID WP_Comment or ID of the comment for which to get the date.
536 536
  *                                    Default current comment.
537 537
  * @return string The comment's date.
538 538
  */
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
562 562
  *
563 563
  * @param string         $d          Optional. The format of the date. Default user's settings.
564
- * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.
564
+ * @param integer $comment_ID WP_Comment or ID of the comment for which to print the date.
565 565
  *                                   Default current comment.
566 566
  */
567 567
 function comment_date( $d = '', $comment_ID = 0 ) {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
  * @since 1.5.0
579 579
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
580 580
  *
581
- * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to get the excerpt.
581
+ * @param integer $comment_ID  WP_Comment or ID of the comment for which to get the excerpt.
582 582
  *                                    Default current comment.
583 583
  * @return string The maybe truncated comment with 20 words or less.
584 584
  */
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
  * @since 1.2.0
625 625
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
626 626
  *
627
- * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to print the excerpt.
627
+ * @param integer $comment_ID  WP_Comment or ID of the comment for which to print the excerpt.
628 628
  *                                    Default current comment.
629 629
  */
630 630
 function comment_excerpt( $comment_ID = 0 ) {
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
  *
796 796
  * @since 1.5.0
797 797
  *
798
- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
798
+ * @param integer $post_id Optional. Post ID or WP_Post object. Default is global $post.
799 799
  * @return string The link to the comments.
800 800
  */
801 801
 function get_comments_link( $post_id = 0 ) {
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
  *
835 835
  * @since 1.5.0
836 836
  *
837
- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
837
+ * @param integer $post_id Optional. Post ID or WP_Post object. Default is global $post.
838 838
  * @return int The number of comments a post has.
839 839
  */
840 840
 function get_comments_number( $post_id = 0 ) {
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
  *
923 923
  * @see Walker_Comment::comment()
924 924
  *
925
- * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to get the text.
925
+ * @param integer  $comment_ID WP_Comment or ID of the comment for which to get the text.
926 926
  *                                    Default current comment.
927 927
  * @param array           $args       Optional. An array of arguments. Default empty.
928 928
  * @return string The comment content.
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
  *
953 953
  * @see Walker_Comment::comment()
954 954
  *
955
- * @param int|WP_Comment  $comment_ID WP_Comment or ID of the comment for which to print the text.
955
+ * @param integer  $comment_ID WP_Comment or ID of the comment for which to print the text.
956 956
  *                                    Default current comment.
957 957
  * @param array           $args       Optional. An array of arguments. Default empty array. Default empty.
958 958
  */
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
  * @since 1.5.0
1026 1026
  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
1027 1027
  *
1028
- * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type.
1028
+ * @param integer $comment_ID Optional. WP_Comment or ID of the comment for which to get the type.
1029 1029
  *                                   Default current comment.
1030 1030
  * @return string The comment type.
1031 1031
  */
Please login to merge, or discard this patch.
Braces   +133 added lines, -88 removed lines patch added patch discarded remove patch
@@ -25,10 +25,11 @@  discard block
 block discarded – undo
25 25
 	$comment = get_comment( $comment_ID );
26 26
 
27 27
 	if ( empty( $comment->comment_author ) ) {
28
-		if ( $comment->user_id && $user = get_userdata( $comment->user_id ) )
29
-			$author = $user->display_name;
30
-		else
31
-			$author = __('Anonymous');
28
+		if ( $comment->user_id && $user = get_userdata( $comment->user_id ) ) {
29
+					$author = $user->display_name;
30
+		} else {
31
+					$author = __('Anonymous');
32
+		}
32 33
 	} else {
33 34
 		$author = $comment->comment_author;
34 35
 	}
@@ -218,10 +219,11 @@  discard block
 block discarded – undo
218 219
 	$url     = get_comment_author_url( $comment );
219 220
 	$author  = get_comment_author( $comment );
220 221
 
221
-	if ( empty( $url ) || 'http://' == $url )
222
-		$return = $author;
223
-	else
224
-		$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
222
+	if ( empty( $url ) || 'http://' == $url ) {
223
+			$return = $author;
224
+	} else {
225
+			$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
226
+	}
225 227
 
226 228
 	/**
227 229
 	 * Filters the comment author's link for display.
@@ -428,11 +430,12 @@  discard block
 block discarded – undo
428 430
 function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) {
429 431
 	// Separates classes with a single space, collates classes for comment DIV
430 432
 	$class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"';
431
-	if ( $echo)
432
-		echo $class;
433
-	else
434
-		return $class;
435
-}
433
+	if ( $echo) {
434
+			echo $class;
435
+	} else {
436
+			return $class;
437
+	}
438
+	}
436 439
 
437 440
 /**
438 441
  * Returns the classes for the comment div as an array.
@@ -474,12 +477,15 @@  discard block
 block discarded – undo
474 477
 		}
475 478
 	}
476 479
 
477
-	if ( empty($comment_alt) )
478
-		$comment_alt = 0;
479
-	if ( empty($comment_depth) )
480
-		$comment_depth = 1;
481
-	if ( empty($comment_thread_alt) )
482
-		$comment_thread_alt = 0;
480
+	if ( empty($comment_alt) ) {
481
+			$comment_alt = 0;
482
+	}
483
+	if ( empty($comment_depth) ) {
484
+			$comment_depth = 1;
485
+	}
486
+	if ( empty($comment_thread_alt) ) {
487
+			$comment_thread_alt = 0;
488
+	}
483 489
 
484 490
 	if ( $comment_alt % 2 ) {
485 491
 		$classes[] = 'odd';
@@ -504,8 +510,9 @@  discard block
 block discarded – undo
504 510
 	$classes[] = "depth-$comment_depth";
505 511
 
506 512
 	if ( !empty($class) ) {
507
-		if ( !is_array( $class ) )
508
-			$class = preg_split('#\s+#', $class);
513
+		if ( !is_array( $class ) ) {
514
+					$class = preg_split('#\s+#', $class);
515
+		}
509 516
 		$classes = array_merge($classes, $class);
510 517
 	}
511 518
 
@@ -538,10 +545,11 @@  discard block
 block discarded – undo
538 545
  */
539 546
 function get_comment_date( $d = '', $comment_ID = 0 ) {
540 547
 	$comment = get_comment( $comment_ID );
541
-	if ( '' == $d )
542
-		$date = mysql2date(get_option('date_format'), $comment->comment_date);
543
-	else
544
-		$date = mysql2date($d, $comment->comment_date);
548
+	if ( '' == $d ) {
549
+			$date = mysql2date(get_option('date_format'), $comment->comment_date);
550
+	} else {
551
+			$date = mysql2date($d, $comment->comment_date);
552
+	}
545 553
 	/**
546 554
 	 * Filters the returned comment date.
547 555
 	 *
@@ -822,10 +830,12 @@  discard block
 block discarded – undo
822 830
  * @param string $deprecated_2 Not Used.
823 831
  */
824 832
 function comments_link( $deprecated = '', $deprecated_2 = '' ) {
825
-	if ( !empty( $deprecated ) )
826
-		_deprecated_argument( __FUNCTION__, '0.72' );
827
-	if ( !empty( $deprecated_2 ) )
828
-		_deprecated_argument( __FUNCTION__, '1.3.0' );
833
+	if ( !empty( $deprecated ) ) {
834
+			_deprecated_argument( __FUNCTION__, '0.72' );
835
+	}
836
+	if ( !empty( $deprecated_2 ) ) {
837
+			_deprecated_argument( __FUNCTION__, '1.3.0' );
838
+	}
829 839
 	echo esc_url( get_comments_link() );
830 840
 }
831 841
 
@@ -1010,10 +1020,11 @@  discard block
 block discarded – undo
1010 1020
 	$comment = get_comment();
1011 1021
 
1012 1022
 	$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
1013
-	if ( '' == $d )
1014
-		$date = mysql2date(get_option('time_format'), $comment_date, $translate);
1015
-	else
1016
-		$date = mysql2date($d, $comment_date, $translate);
1023
+	if ( '' == $d ) {
1024
+			$date = mysql2date(get_option('time_format'), $comment_date, $translate);
1025
+	} else {
1026
+			$date = mysql2date($d, $comment_date, $translate);
1027
+	}
1017 1028
 
1018 1029
 	/**
1019 1030
 	 * Filters the returned comment time.
@@ -1052,8 +1063,9 @@  discard block
 block discarded – undo
1052 1063
  */
1053 1064
 function get_comment_type( $comment_ID = 0 ) {
1054 1065
 	$comment = get_comment( $comment_ID );
1055
-	if ( '' == $comment->comment_type )
1056
-		$comment->comment_type = 'comment';
1066
+	if ( '' == $comment->comment_type ) {
1067
+			$comment->comment_type = 'comment';
1068
+	}
1057 1069
 
1058 1070
 	/**
1059 1071
 	 * Filters the returned comment type.
@@ -1078,9 +1090,15 @@  discard block
 block discarded – undo
1078 1090
  * @param string $pingbacktxt  Optional. String to display for pingback type. Default false.
1079 1091
  */
1080 1092
 function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {
1081
-	if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );
1082
-	if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );
1083
-	if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );
1093
+	if ( false === $commenttxt ) {
1094
+		$commenttxt = _x( 'Comment', 'noun' );
1095
+	}
1096
+	if ( false === $trackbacktxt ) {
1097
+		$trackbacktxt = __( 'Trackback' );
1098
+	}
1099
+	if ( false === $pingbacktxt ) {
1100
+		$pingbacktxt = __( 'Pingback' );
1101
+	}
1084 1102
 	$type = get_comment_type();
1085 1103
 	switch( $type ) {
1086 1104
 		case 'trackback' :
@@ -1106,10 +1124,11 @@  discard block
 block discarded – undo
1106 1124
  * @return string The trackback URL after being filtered.
1107 1125
  */
1108 1126
 function get_trackback_url() {
1109
-	if ( '' != get_option('permalink_structure') )
1110
-		$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
1111
-	else
1112
-		$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
1127
+	if ( '' != get_option('permalink_structure') ) {
1128
+			$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
1129
+	} else {
1130
+			$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
1131
+	}
1113 1132
 
1114 1133
 	/**
1115 1134
 	 * Filters the returned trackback URL.
@@ -1291,11 +1310,13 @@  discard block
 block discarded – undo
1291 1310
 function comments_template( $file = '/comments.php', $separate_comments = false ) {
1292 1311
 	global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
1293 1312
 
1294
-	if ( !(is_single() || is_page() || $withcomments) || empty($post) )
1295
-		return;
1313
+	if ( !(is_single() || is_page() || $withcomments) || empty($post) ) {
1314
+			return;
1315
+	}
1296 1316
 
1297
-	if ( empty($file) )
1298
-		$file = '/comments.php';
1317
+	if ( empty($file) ) {
1318
+			$file = '/comments.php';
1319
+	}
1299 1320
 
1300 1321
 	$req = get_option('require_name_email');
1301 1322
 
@@ -1453,8 +1474,9 @@  discard block
 block discarded – undo
1453 1474
 		$overridden_cpage = true;
1454 1475
 	}
1455 1476
 
1456
-	if ( !defined('COMMENTS_TEMPLATE') )
1457
-		define('COMMENTS_TEMPLATE', true);
1477
+	if ( !defined('COMMENTS_TEMPLATE') ) {
1478
+			define('COMMENTS_TEMPLATE', true);
1479
+	}
1458 1480
 
1459 1481
 	$theme_template = STYLESHEETPATH . $file;
1460 1482
 	/**
@@ -1465,13 +1487,15 @@  discard block
 block discarded – undo
1465 1487
 	 * @param string $theme_template The path to the theme template file.
1466 1488
 	 */
1467 1489
 	$include = apply_filters( 'comments_template', $theme_template );
1468
-	if ( file_exists( $include ) )
1469
-		require( $include );
1470
-	elseif ( file_exists( TEMPLATEPATH . $file ) )
1471
-		require( TEMPLATEPATH . $file );
1472
-	else // Backward compat code will be removed in a future release
1490
+	if ( file_exists( $include ) ) {
1491
+			require( $include );
1492
+	} elseif ( file_exists( TEMPLATEPATH . $file ) ) {
1493
+			require( TEMPLATEPATH . $file );
1494
+	} else {
1495
+		// Backward compat code will be removed in a future release
1473 1496
 		require( ABSPATH . WPINC . '/theme-compat/comments.php');
1474
-}
1497
+	}
1498
+	}
1475 1499
 
1476 1500
 /**
1477 1501
  * Displays the link to the comments for the current post ID.
@@ -1774,8 +1798,9 @@  discard block
 block discarded – undo
1774 1798
  * @return string
1775 1799
  */
1776 1800
 function get_cancel_comment_reply_link( $text = '' ) {
1777
-	if ( empty($text) )
1778
-		$text = __('Click here to cancel reply.');
1801
+	if ( empty($text) ) {
1802
+			$text = __('Click here to cancel reply.');
1803
+	}
1779 1804
 
1780 1805
 	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
1781 1806
 	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
@@ -1814,8 +1839,9 @@  discard block
 block discarded – undo
1814 1839
  * @return string Hidden input HTML for replying to comments
1815 1840
  */
1816 1841
 function get_comment_id_fields( $id = 0 ) {
1817
-	if ( empty( $id ) )
1818
-		$id = get_the_ID();
1842
+	if ( empty( $id ) ) {
1843
+			$id = get_the_ID();
1844
+	}
1819 1845
 
1820 1846
 	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
1821 1847
 	$result  = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
@@ -1867,14 +1893,18 @@  discard block
 block discarded – undo
1867 1893
 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
1868 1894
 	global $comment;
1869 1895
 
1870
-	if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
1871
-	if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
1896
+	if ( false === $noreplytext ) {
1897
+		$noreplytext = __( 'Leave a Reply' );
1898
+	}
1899
+	if ( false === $replytext ) {
1900
+		$replytext = __( 'Leave a Reply to %s' );
1901
+	}
1872 1902
 
1873 1903
 	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
1874 1904
 
1875
-	if ( 0 == $replytoid )
1876
-		echo $noreplytext;
1877
-	else {
1905
+	if ( 0 == $replytoid ) {
1906
+			echo $noreplytext;
1907
+	} else {
1878 1908
 		// Sets the global so that template tags can be used in the comment form.
1879 1909
 		$comment = get_comment($replytoid);
1880 1910
 		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' : get_comment_author( $comment );
@@ -1961,12 +1991,14 @@  discard block
 block discarded – undo
1961 1991
 	// Figure out what comments we'll be looping through ($_comments)
1962 1992
 	if ( null !== $comments ) {
1963 1993
 		$comments = (array) $comments;
1964
-		if ( empty($comments) )
1965
-			return;
1994
+		if ( empty($comments) ) {
1995
+					return;
1996
+		}
1966 1997
 		if ( 'all' != $r['type'] ) {
1967 1998
 			$comments_by_type = separate_comments($comments);
1968
-			if ( empty($comments_by_type[$r['type']]) )
1969
-				return;
1999
+			if ( empty($comments_by_type[$r['type']]) ) {
2000
+							return;
2001
+			}
1970 2002
 			$_comments = $comments_by_type[$r['type']];
1971 2003
 		} else {
1972 2004
 			$_comments = $comments;
@@ -2016,13 +2048,16 @@  discard block
 block discarded – undo
2016 2048
 
2017 2049
 		// Otherwise, fall back on the comments from `$wp_query->comments`.
2018 2050
 		} else {
2019
-			if ( empty($wp_query->comments) )
2020
-				return;
2051
+			if ( empty($wp_query->comments) ) {
2052
+							return;
2053
+			}
2021 2054
 			if ( 'all' != $r['type'] ) {
2022
-				if ( empty($wp_query->comments_by_type) )
2023
-					$wp_query->comments_by_type = separate_comments($wp_query->comments);
2024
-				if ( empty($wp_query->comments_by_type[$r['type']]) )
2025
-					return;
2055
+				if ( empty($wp_query->comments_by_type) ) {
2056
+									$wp_query->comments_by_type = separate_comments($wp_query->comments);
2057
+				}
2058
+				if ( empty($wp_query->comments_by_type[$r['type']]) ) {
2059
+									return;
2060
+				}
2026 2061
 				$_comments = $wp_query->comments_by_type[$r['type']];
2027 2062
 			} else {
2028 2063
 				$_comments = $wp_query->comments;
@@ -2060,10 +2095,11 @@  discard block
 block discarded – undo
2060 2095
 	}
2061 2096
 
2062 2097
 	if ( '' === $r['max_depth'] ) {
2063
-		if ( get_option('thread_comments') )
2064
-			$r['max_depth'] = get_option('thread_comments_depth');
2065
-		else
2066
-			$r['max_depth'] = -1;
2098
+		if ( get_option('thread_comments') ) {
2099
+					$r['max_depth'] = get_option('thread_comments_depth');
2100
+		} else {
2101
+					$r['max_depth'] = -1;
2102
+		}
2067 2103
 	}
2068 2104
 
2069 2105
 	if ( '' === $r['page'] ) {
@@ -2077,11 +2113,13 @@  discard block
 block discarded – undo
2077 2113
 	}
2078 2114
 	// Validation check
2079 2115
 	$r['page'] = intval($r['page']);
2080
-	if ( 0 == $r['page'] && 0 != $r['per_page'] )
2081
-		$r['page'] = 1;
2116
+	if ( 0 == $r['page'] && 0 != $r['per_page'] ) {
2117
+			$r['page'] = 1;
2118
+	}
2082 2119
 
2083
-	if ( null === $r['reverse_top_level'] )
2084
-		$r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
2120
+	if ( null === $r['reverse_top_level'] ) {
2121
+			$r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
2122
+	}
2085 2123
 
2086 2124
 	wp_queue_comments_for_comment_meta_lazyload( $_comments );
2087 2125
 
@@ -2165,8 +2203,9 @@  discard block
 block discarded – undo
2165 2203
  * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.
2166 2204
  */
2167 2205
 function comment_form( $args = array(), $post_id = null ) {
2168
-	if ( null === $post_id )
2169
-		$post_id = get_the_ID();
2206
+	if ( null === $post_id ) {
2207
+			$post_id = get_the_ID();
2208
+	}
2170 2209
 
2171 2210
 	// Exit the function when comments for the post are closed.
2172 2211
 	if ( ! comments_open( $post_id ) ) {
@@ -2185,8 +2224,9 @@  discard block
 block discarded – undo
2185 2224
 	$user_identity = $user->exists() ? $user->display_name : '';
2186 2225
 
2187 2226
 	$args = wp_parse_args( $args );
2188
-	if ( ! isset( $args['format'] ) )
2189
-		$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
2227
+	if ( ! isset( $args['format'] ) ) {
2228
+			$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
2229
+	}
2190 2230
 
2191 2231
 	$req      = get_option( 'require_name_email' );
2192 2232
 	$aria_req = ( $req ? " aria-required='true'" : '' );
@@ -2294,8 +2334,11 @@  discard block
 block discarded – undo
2294 2334
 			 * @since 3.0.0
2295 2335
 			 */
2296 2336
 			do_action( 'comment_form_must_log_in_after' );
2297
-		else : ?>
2298
-			<form action="<?php echo esc_url( $args['action'] ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
2337
+		else {
2338
+			: ?>
2339
+			<form action="<?php echo esc_url( $args['action'] );
2340
+		}
2341
+		?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
2299 2342
 				<?php
2300 2343
 				/**
2301 2344
 				 * Fires at the top of the comment form, inside the form tag.
@@ -2330,9 +2373,11 @@  discard block
 block discarded – undo
2330 2373
 					 */
2331 2374
 					do_action( 'comment_form_logged_in_after', $commenter, $user_identity );
2332 2375
 
2333
-				else :
2376
+				else {
2377
+					:
2334 2378
 
2335 2379
 					echo $args['comment_notes_before'];
2380
+				}
2336 2381
 
2337 2382
 				endif;
2338 2383
 
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2196,11 +2196,11 @@  discard block
 block discarded – undo
2196 2196
 	$html5    = 'html5' === $args['format'];
2197 2197
 	$fields   =  array(
2198 2198
 		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
2199
-		            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
2199
+					'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
2200 2200
 		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
2201
-		            '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
2201
+					'<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
2202 2202
 		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
2203
-		            '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
2203
+					'<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
2204 2204
 	);
2205 2205
 
2206 2206
 	$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
@@ -2218,20 +2218,20 @@  discard block
 block discarded – undo
2218 2218
 		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
2219 2219
 		/** This filter is documented in wp-includes/link-template.php */
2220 2220
 		'must_log_in'          => '<p class="must-log-in">' . sprintf(
2221
-		                              /* translators: %s: login URL */
2222
-		                              __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
2223
-		                              wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2224
-		                          ) . '</p>',
2221
+									  /* translators: %s: login URL */
2222
+									  __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
2223
+									  wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2224
+								  ) . '</p>',
2225 2225
 		/** This filter is documented in wp-includes/link-template.php */
2226 2226
 		'logged_in_as'         => '<p class="logged-in-as">' . sprintf(
2227
-		                              /* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
2228
-		                              __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
2229
-		                              get_edit_user_link(),
2230
-		                              /* translators: %s: user name */
2231
-		                              esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
2232
-		                              $user_identity,
2233
-		                              wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2234
-		                          ) . '</p>',
2227
+									  /* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
2228
+									  __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
2229
+									  get_edit_user_link(),
2230
+									  /* translators: %s: user name */
2231
+									  esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
2232
+									  $user_identity,
2233
+									  wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2234
+								  ) . '</p>',
2235 2235
 		'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
2236 2236
 		'comment_notes_after'  => '',
2237 2237
 		'action'               => site_url( '/wp-comments-post.php' ),
Please login to merge, or discard this patch.
Spacing   +418 added lines, -418 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
  *									 Default current comment.
22 22
  * @return string The comment author
23 23
  */
24
-function get_comment_author( $comment_ID = 0 ) {
25
-	$comment = get_comment( $comment_ID );
24
+function get_comment_author($comment_ID = 0) {
25
+	$comment = get_comment($comment_ID);
26 26
 
27
-	if ( empty( $comment->comment_author ) ) {
28
-		if ( $comment->user_id && $user = get_userdata( $comment->user_id ) )
27
+	if (empty($comment->comment_author)) {
28
+		if ($comment->user_id && $user = get_userdata($comment->user_id))
29 29
 			$author = $user->display_name;
30 30
 		else
31 31
 			$author = __('Anonymous');
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param int        $comment_ID The comment ID.
44 44
 	 * @param WP_Comment $comment    The comment object.
45 45
 	 */
46
-	return apply_filters( 'get_comment_author', $author, $comment->comment_ID, $comment );
46
+	return apply_filters('get_comment_author', $author, $comment->comment_ID, $comment);
47 47
 }
48 48
 
49 49
 /**
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
56 56
  *									 Default current comment.
57 57
  */
58
-function comment_author( $comment_ID = 0 ) {
59
-	$comment = get_comment( $comment_ID );
60
-	$author  = get_comment_author( $comment );
58
+function comment_author($comment_ID = 0) {
59
+	$comment = get_comment($comment_ID);
60
+	$author  = get_comment_author($comment);
61 61
 
62 62
 	/**
63 63
 	 * Filters the comment author's name for display.
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param string $author     The comment author's username.
69 69
 	 * @param int    $comment_ID The comment ID.
70 70
 	 */
71
-	echo apply_filters( 'comment_author', $author, $comment->comment_ID );
71
+	echo apply_filters('comment_author', $author, $comment->comment_ID);
72 72
 }
73 73
 
74 74
 /**
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
  *									 Default current comment.
82 82
  * @return string The current comment author's email
83 83
  */
84
-function get_comment_author_email( $comment_ID = 0 ) {
85
-	$comment = get_comment( $comment_ID );
84
+function get_comment_author_email($comment_ID = 0) {
85
+	$comment = get_comment($comment_ID);
86 86
 
87 87
 	/**
88 88
 	 * Filters the comment author's returned email address.
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @param int        $comment_ID           The comment ID.
95 95
 	 * @param WP_Comment $comment              The comment object.
96 96
 	 */
97
-	return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );
97
+	return apply_filters('get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment);
98 98
 }
99 99
 
100 100
 /**
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
113 113
  *									 Default current comment.
114 114
  */
115
-function comment_author_email( $comment_ID = 0 ) {
116
-	$comment      = get_comment( $comment_ID );
117
-	$author_email = get_comment_author_email( $comment );
115
+function comment_author_email($comment_ID = 0) {
116
+	$comment      = get_comment($comment_ID);
117
+	$author_email = get_comment_author_email($comment);
118 118
 
119 119
 	/**
120 120
 	 * Filters the comment author's email for display.
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @param string $author_email The comment author's email address.
126 126
 	 * @param int    $comment_ID   The comment ID.
127 127
 	 */
128
-	echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
128
+	echo apply_filters('author_email', $author_email, $comment->comment_ID);
129 129
 }
130 130
 
131 131
 /**
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
  * @param string         $after    Optional. Text or HTML to display after the email link. Default empty.
147 147
  * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object. Default is the current comment.
148 148
  */
149
-function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {
150
-	if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) {
149
+function comment_author_email_link($linktext = '', $before = '', $after = '', $comment = null) {
150
+	if ($link = get_comment_author_email_link($linktext, $before, $after, $comment)) {
151 151
 		echo $link;
152 152
 	}
153 153
 }
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
  * @return string HTML markup for the comment author email link. By default, the email address is obfuscated
173 173
  *                via the {@see 'comment_email'} filter with antispambot().
174 174
  */
175
-function get_comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {
176
-	$comment = get_comment( $comment );
175
+function get_comment_author_email_link($linktext = '', $before = '', $after = '', $comment = null) {
176
+	$comment = get_comment($comment);
177 177
 
178 178
 	/**
179 179
 	 * Filters the comment author's email for display.
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
 	 * @param string     $comment_author_email The comment author's email address.
188 188
 	 * @param WP_Comment $comment              The comment object.
189 189
 	 */
190
-	$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
190
+	$email = apply_filters('comment_email', $comment->comment_author_email, $comment);
191 191
 
192
-	if ((!empty($email)) && ($email != '@')) {
192
+	if (( ! empty($email)) && ($email != '@')) {
193 193
 	$display = ($linktext != '') ? $linktext : $email;
194 194
 		$return  = $before;
195
-		$return .= sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) );
195
+		$return .= sprintf('<a href="%1$s">%2$s</a>', esc_url('mailto:'.$email), esc_html($display));
196 196
 	 	$return .= $after;
197 197
 		return $return;
198 198
 	} else {
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
  *									 Default current comment.
214 214
  * @return string The comment author name or HTML link for author's URL.
215 215
  */
216
-function get_comment_author_link( $comment_ID = 0 ) {
217
-	$comment = get_comment( $comment_ID );
218
-	$url     = get_comment_author_url( $comment );
219
-	$author  = get_comment_author( $comment );
216
+function get_comment_author_link($comment_ID = 0) {
217
+	$comment = get_comment($comment_ID);
218
+	$url     = get_comment_author_url($comment);
219
+	$author  = get_comment_author($comment);
220 220
 
221
-	if ( empty( $url ) || 'http://' == $url )
221
+	if (empty($url) || 'http://' == $url)
222 222
 		$return = $author;
223 223
 	else
224 224
 		$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	 * @param string $author     The comment author's username.
235 235
 	 * @param int    $comment_ID The comment ID.
236 236
 	 */
237
-	return apply_filters( 'get_comment_author_link', $return, $author, $comment->comment_ID );
237
+	return apply_filters('get_comment_author_link', $return, $author, $comment->comment_ID);
238 238
 }
239 239
 
240 240
 /**
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
247 247
  *									 Default current comment.
248 248
  */
249
-function comment_author_link( $comment_ID = 0 ) {
250
-	echo get_comment_author_link( $comment_ID );
249
+function comment_author_link($comment_ID = 0) {
250
+	echo get_comment_author_link($comment_ID);
251 251
 }
252 252
 
253 253
 /**
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
  *									 Default current comment.
261 261
  * @return string Comment author's IP address.
262 262
  */
263
-function get_comment_author_IP( $comment_ID = 0 ) {
264
-	$comment = get_comment( $comment_ID );
263
+function get_comment_author_IP($comment_ID = 0) {
264
+	$comment = get_comment($comment_ID);
265 265
 
266 266
 	/**
267 267
 	 * Filters the comment author's returned IP address.
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 * @param int        $comment_ID        The comment ID.
274 274
 	 * @param WP_Comment $comment           The comment object.
275 275
 	 */
276
-	return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment );
276
+	return apply_filters('get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment);
277 277
 }
278 278
 
279 279
 /**
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
286 286
  *									 Default current comment.
287 287
  */
288
-function comment_author_IP( $comment_ID = 0 ) {
289
-	echo esc_html( get_comment_author_IP( $comment_ID ) );
288
+function comment_author_IP($comment_ID = 0) {
289
+	echo esc_html(get_comment_author_IP($comment_ID));
290 290
 }
291 291
 
292 292
 /**
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
  *									 Default current comment.
300 300
  * @return string Comment author URL.
301 301
  */
302
-function get_comment_author_url( $comment_ID = 0 ) {
303
-	$comment = get_comment( $comment_ID );
302
+function get_comment_author_url($comment_ID = 0) {
303
+	$comment = get_comment($comment_ID);
304 304
 	$url = '';
305 305
 	$id = 0;
306
-	if ( ! empty( $comment ) ) {
307
-		$author_url = ( 'http://' == $comment->comment_author_url ) ? '' : $comment->comment_author_url;
308
-		$url = esc_url( $author_url, array( 'http', 'https' ) );
306
+	if ( ! empty($comment)) {
307
+		$author_url = ('http://' == $comment->comment_author_url) ? '' : $comment->comment_author_url;
308
+		$url = esc_url($author_url, array('http', 'https'));
309 309
 		$id = $comment->ID;
310 310
 	}
311 311
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @param int        $comment_ID The comment ID.
320 320
 	 * @param WP_Comment $comment    The comment object.
321 321
 	 */
322
-	return apply_filters( 'get_comment_author_url', $url, $id, $comment );
322
+	return apply_filters('get_comment_author_url', $url, $id, $comment);
323 323
 }
324 324
 
325 325
 /**
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
332 332
  *									 Default current comment.
333 333
  */
334
-function comment_author_url( $comment_ID = 0 ) {
335
-	$comment    = get_comment( $comment_ID );
336
-	$author_url = get_comment_author_url( $comment );
334
+function comment_author_url($comment_ID = 0) {
335
+	$comment    = get_comment($comment_ID);
336
+	$author_url = get_comment_author_url($comment);
337 337
 
338 338
 	/**
339 339
 	 * Filters the comment author's URL for display.
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 * @param string $author_url The comment author's URL.
345 345
 	 * @param int    $comment_ID The comment ID.
346 346
 	 */
347
-	echo apply_filters( 'comment_url', $author_url, $comment->comment_ID );
347
+	echo apply_filters('comment_url', $author_url, $comment->comment_ID);
348 348
 }
349 349
 
350 350
 /**
@@ -370,13 +370,13 @@  discard block
 block discarded – undo
370 370
  *                                 Default is the current comment.
371 371
  * @return string The HTML link between the $before and $after parameters.
372 372
  */
373
-function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
374
-	$url = get_comment_author_url( $comment );
373
+function get_comment_author_url_link($linktext = '', $before = '', $after = '', $comment = 0) {
374
+	$url = get_comment_author_url($comment);
375 375
 	$display = ($linktext != '') ? $linktext : $url;
376
-	$display = str_replace( 'http://www.', '', $display );
377
-	$display = str_replace( 'http://', '', $display );
376
+	$display = str_replace('http://www.', '', $display);
377
+	$display = str_replace('http://', '', $display);
378 378
 
379
-	if ( '/' == substr($display, -1) ) {
379
+	if ('/' == substr($display, -1)) {
380 380
 		$display = substr($display, 0, -1);
381 381
 	}
382 382
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	 *
390 390
 	 * @param string $return The HTML-formatted comment author URL link.
391 391
 	 */
392
-	return apply_filters( 'get_comment_author_url_link', $return );
392
+	return apply_filters('get_comment_author_url_link', $return);
393 393
 }
394 394
 
395 395
 /**
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
  * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.
408 408
  *                                 Default is the current comment.
409 409
  */
410
-function comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
411
-	echo get_comment_author_url_link( $linktext, $before, $after, $comment );
410
+function comment_author_url_link($linktext = '', $before = '', $after = '', $comment = 0) {
411
+	echo get_comment_author_url_link($linktext, $before, $after, $comment);
412 412
 }
413 413
 
414 414
 /**
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
  *                                 Default true.
426 426
  * @return string If `$echo` is false, the class will be returned. Void otherwise.
427 427
  */
428
-function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) {
428
+function comment_class($class = '', $comment = null, $post_id = null, $echo = true) {
429 429
 	// Separates classes with a single space, collates classes for comment DIV
430
-	$class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"';
431
-	if ( $echo)
430
+	$class = 'class="'.join(' ', get_comment_class($class, $comment, $post_id)).'"';
431
+	if ($echo)
432 432
 		echo $class;
433 433
 	else
434 434
 		return $class;
@@ -449,39 +449,39 @@  discard block
 block discarded – undo
449 449
  * @param int|WP_Post    $post_id    Post ID or WP_Post object. Default current post.
450 450
  * @return array An array of classes.
451 451
  */
452
-function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
452
+function get_comment_class($class = '', $comment_id = null, $post_id = null) {
453 453
 	global $comment_alt, $comment_depth, $comment_thread_alt;
454 454
 
455 455
 	$classes = array();
456 456
 
457
-	$comment = get_comment( $comment_id );
458
-	if ( ! $comment ) {
457
+	$comment = get_comment($comment_id);
458
+	if ( ! $comment) {
459 459
 		return $classes;
460 460
 	}
461 461
 
462 462
 	// Get the comment type (comment, trackback),
463
-	$classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type;
463
+	$classes[] = (empty($comment->comment_type)) ? 'comment' : $comment->comment_type;
464 464
 
465 465
 	// Add classes for comment authors that are registered users.
466
-	if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) {
466
+	if ($comment->user_id > 0 && $user = get_userdata($comment->user_id)) {
467 467
 		$classes[] = 'byuser';
468
-		$classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
468
+		$classes[] = 'comment-author-'.sanitize_html_class($user->user_nicename, $comment->user_id);
469 469
 		// For comment authors who are the author of the post
470
-		if ( $post = get_post($post_id) ) {
471
-			if ( $comment->user_id === $post->post_author ) {
470
+		if ($post = get_post($post_id)) {
471
+			if ($comment->user_id === $post->post_author) {
472 472
 				$classes[] = 'bypostauthor';
473 473
 			}
474 474
 		}
475 475
 	}
476 476
 
477
-	if ( empty($comment_alt) )
477
+	if (empty($comment_alt))
478 478
 		$comment_alt = 0;
479
-	if ( empty($comment_depth) )
479
+	if (empty($comment_depth))
480 480
 		$comment_depth = 1;
481
-	if ( empty($comment_thread_alt) )
481
+	if (empty($comment_thread_alt))
482 482
 		$comment_thread_alt = 0;
483 483
 
484
-	if ( $comment_alt % 2 ) {
484
+	if ($comment_alt % 2) {
485 485
 		$classes[] = 'odd';
486 486
 		$classes[] = 'alt';
487 487
 	} else {
@@ -491,8 +491,8 @@  discard block
 block discarded – undo
491 491
 	$comment_alt++;
492 492
 
493 493
 	// Alt for top-level comments
494
-	if ( 1 == $comment_depth ) {
495
-		if ( $comment_thread_alt % 2 ) {
494
+	if (1 == $comment_depth) {
495
+		if ($comment_thread_alt % 2) {
496 496
 			$classes[] = 'thread-odd';
497 497
 			$classes[] = 'thread-alt';
498 498
 		} else {
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
 
504 504
 	$classes[] = "depth-$comment_depth";
505 505
 
506
-	if ( !empty($class) ) {
507
-		if ( !is_array( $class ) )
506
+	if ( ! empty($class)) {
507
+		if ( ! is_array($class))
508 508
 			$class = preg_split('#\s+#', $class);
509 509
 		$classes = array_merge($classes, $class);
510 510
 	}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	 * @param WP_Comment  $comment    The comment object.
523 523
 	 * @param int|WP_Post $post_id    The post ID or WP_Post object.
524 524
 	 */
525
-	return apply_filters( 'comment_class', $classes, $class, $comment->comment_ID, $comment, $post_id );
525
+	return apply_filters('comment_class', $classes, $class, $comment->comment_ID, $comment, $post_id);
526 526
 }
527 527
 
528 528
 /**
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
  *                                    Default current comment.
537 537
  * @return string The comment's date.
538 538
  */
539
-function get_comment_date( $d = '', $comment_ID = 0 ) {
540
-	$comment = get_comment( $comment_ID );
541
-	if ( '' == $d )
539
+function get_comment_date($d = '', $comment_ID = 0) {
540
+	$comment = get_comment($comment_ID);
541
+	if ('' == $d)
542 542
 		$date = mysql2date(get_option('date_format'), $comment->comment_date);
543 543
 	else
544 544
 		$date = mysql2date($d, $comment->comment_date);
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	 * @param string     $d       The format of the date.
552 552
 	 * @param WP_Comment $comment The comment object.
553 553
 	 */
554
-	return apply_filters( 'get_comment_date', $date, $d, $comment );
554
+	return apply_filters('get_comment_date', $date, $d, $comment);
555 555
 }
556 556
 
557 557
 /**
@@ -564,8 +564,8 @@  discard block
 block discarded – undo
564 564
  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.
565 565
  *                                   Default current comment.
566 566
  */
567
-function comment_date( $d = '', $comment_ID = 0 ) {
568
-	echo get_comment_date( $d, $comment_ID );
567
+function comment_date($d = '', $comment_ID = 0) {
568
+	echo get_comment_date($d, $comment_ID);
569 569
 }
570 570
 
571 571
 /**
@@ -582,10 +582,10 @@  discard block
 block discarded – undo
582 582
  *                                    Default current comment.
583 583
  * @return string The maybe truncated comment with 20 words or less.
584 584
  */
585
-function get_comment_excerpt( $comment_ID = 0 ) {
586
-	$comment = get_comment( $comment_ID );
587
-	$comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) );
588
-	$words = explode( ' ', $comment_text );
585
+function get_comment_excerpt($comment_ID = 0) {
586
+	$comment = get_comment($comment_ID);
587
+	$comment_text = strip_tags(str_replace(array("\n", "\r"), ' ', $comment->comment_content));
588
+	$words = explode(' ', $comment_text);
589 589
 
590 590
 	/**
591 591
 	 * Filters the amount of words used in the comment excerpt.
@@ -594,15 +594,15 @@  discard block
 block discarded – undo
594 594
 	 *
595 595
 	 * @param int $comment_excerpt_length The amount of words you want to display in the comment excerpt.
596 596
 	 */
597
-	$comment_excerpt_length = apply_filters( 'comment_excerpt_length', 20 );
597
+	$comment_excerpt_length = apply_filters('comment_excerpt_length', 20);
598 598
 
599
-	$use_ellipsis = count( $words ) > $comment_excerpt_length;
600
-	if ( $use_ellipsis ) {
601
-		$words = array_slice( $words, 0, $comment_excerpt_length );
599
+	$use_ellipsis = count($words) > $comment_excerpt_length;
600
+	if ($use_ellipsis) {
601
+		$words = array_slice($words, 0, $comment_excerpt_length);
602 602
 	}
603 603
 
604
-	$excerpt = trim( join( ' ', $words ) );
605
-	if ( $use_ellipsis ) {
604
+	$excerpt = trim(join(' ', $words));
605
+	if ($use_ellipsis) {
606 606
 		$excerpt .= '&hellip;';
607 607
 	}
608 608
 	/**
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	 * @param int        $comment_ID The comment ID.
616 616
 	 * @param WP_Comment $comment    The comment object.
617 617
 	 */
618
-	return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment );
618
+	return apply_filters('get_comment_excerpt', $excerpt, $comment->comment_ID, $comment);
619 619
 }
620 620
 
621 621
 /**
@@ -627,9 +627,9 @@  discard block
 block discarded – undo
627 627
  * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to print the excerpt.
628 628
  *                                    Default current comment.
629 629
  */
630
-function comment_excerpt( $comment_ID = 0 ) {
631
-	$comment         = get_comment( $comment_ID );
632
-	$comment_excerpt = get_comment_excerpt( $comment );
630
+function comment_excerpt($comment_ID = 0) {
631
+	$comment         = get_comment($comment_ID);
632
+	$comment_excerpt = get_comment_excerpt($comment);
633 633
 
634 634
 	/**
635 635
 	 * Filters the comment excerpt for display.
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 * @param string $comment_excerpt The comment excerpt text.
641 641
 	 * @param int    $comment_ID      The comment ID.
642 642
 	 */
643
-	echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID );
643
+	echo apply_filters('comment_excerpt', $comment_excerpt, $comment->comment_ID);
644 644
 }
645 645
 
646 646
 /**
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 	 * @param int        $comment_ID The current comment ID.
663 663
 	 * @param WP_Comment $comment    The comment object.
664 664
 	 */
665
-	return apply_filters( 'get_comment_ID', $comment->comment_ID, $comment );
665
+	return apply_filters('get_comment_ID', $comment->comment_ID, $comment);
666 666
 }
667 667
 
668 668
 /**
@@ -699,14 +699,14 @@  discard block
 block discarded – undo
699 699
  * }
700 700
  * @return string The permalink to the given comment.
701 701
  */
702
-function get_comment_link( $comment = null, $args = array() ) {
702
+function get_comment_link($comment = null, $args = array()) {
703 703
 	global $wp_rewrite, $in_comment_loop;
704 704
 
705 705
 	$comment = get_comment($comment);
706 706
 
707 707
 	// Back-compat.
708
-	if ( ! is_array( $args ) ) {
709
-		$args = array( 'page' => $args );
708
+	if ( ! is_array($args)) {
709
+		$args = array('page' => $args);
710 710
 	}
711 711
 
712 712
 	$defaults = array(
@@ -716,33 +716,33 @@  discard block
 block discarded – undo
716 716
 		'max_depth' => '',
717 717
 		'cpage'     => null,
718 718
 	);
719
-	$args = wp_parse_args( $args, $defaults );
719
+	$args = wp_parse_args($args, $defaults);
720 720
 
721
-	$link = get_permalink( $comment->comment_post_ID );
721
+	$link = get_permalink($comment->comment_post_ID);
722 722
 
723 723
 	// The 'cpage' param takes precedence.
724
-	if ( ! is_null( $args['cpage'] ) ) {
724
+	if ( ! is_null($args['cpage'])) {
725 725
 		$cpage = $args['cpage'];
726 726
 
727 727
 	// No 'cpage' is provided, so we calculate one.
728 728
 	} else {
729
-		if ( '' === $args['per_page'] && get_option( 'page_comments' ) ) {
729
+		if ('' === $args['per_page'] && get_option('page_comments')) {
730 730
 			$args['per_page'] = get_option('comments_per_page');
731 731
 		}
732 732
 
733
-		if ( empty( $args['per_page'] ) ) {
733
+		if (empty($args['per_page'])) {
734 734
 			$args['per_page'] = 0;
735 735
 			$args['page'] = 0;
736 736
 		}
737 737
 
738 738
 		$cpage = $args['page'];
739 739
 
740
-		if ( '' == $cpage ) {
741
-			if ( ! empty( $in_comment_loop ) ) {
742
-				$cpage = get_query_var( 'cpage' );
740
+		if ('' == $cpage) {
741
+			if ( ! empty($in_comment_loop)) {
742
+				$cpage = get_query_var('cpage');
743 743
 			} else {
744 744
 				// Requires a database hit, so we only do it when we can't figure out from context.
745
-				$cpage = get_page_of_comment( $comment->comment_ID, $args );
745
+				$cpage = get_page_of_comment($comment->comment_ID, $args);
746 746
 			}
747 747
 		}
748 748
 
@@ -750,29 +750,29 @@  discard block
 block discarded – undo
750 750
 		 * If the default page displays the oldest comments, the permalinks for comments on the default page
751 751
 		 * do not need a 'cpage' query var.
752 752
 		 */
753
-		if ( 'oldest' === get_option( 'default_comments_page' ) && 1 === $cpage ) {
753
+		if ('oldest' === get_option('default_comments_page') && 1 === $cpage) {
754 754
 			$cpage = '';
755 755
 		}
756 756
 	}
757 757
 
758
-	if ( $cpage && get_option( 'page_comments' ) ) {
759
-		if ( $wp_rewrite->using_permalinks() ) {
760
-			if ( $cpage ) {
761
-				$link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;
758
+	if ($cpage && get_option('page_comments')) {
759
+		if ($wp_rewrite->using_permalinks()) {
760
+			if ($cpage) {
761
+				$link = trailingslashit($link).$wp_rewrite->comments_pagination_base.'-'.$cpage;
762 762
 			}
763 763
 
764
-			$link = user_trailingslashit( $link, 'comment' );
765
-		} elseif ( $cpage ) {
766
-			$link = add_query_arg( 'cpage', $cpage, $link );
764
+			$link = user_trailingslashit($link, 'comment');
765
+		} elseif ($cpage) {
766
+			$link = add_query_arg('cpage', $cpage, $link);
767 767
 		}
768 768
 
769 769
 	}
770 770
 
771
-	if ( $wp_rewrite->using_permalinks() ) {
772
-		$link = user_trailingslashit( $link, 'comment' );
771
+	if ($wp_rewrite->using_permalinks()) {
772
+		$link = user_trailingslashit($link, 'comment');
773 773
 	}
774 774
 
775
-	$link = $link . '#comment-' . $comment->comment_ID;
775
+	$link = $link.'#comment-'.$comment->comment_ID;
776 776
 
777 777
 	/**
778 778
 	 * Filters the returned single comment permalink.
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 	 * @param array      $args    An array of arguments to override the defaults.
788 788
 	 * @param int        $cpage   The calculated 'cpage' value.
789 789
 	 */
790
-	return apply_filters( 'get_comment_link', $link, $comment, $args, $cpage );
790
+	return apply_filters('get_comment_link', $link, $comment, $args, $cpage);
791 791
 }
792 792
 
793 793
 /**
@@ -798,9 +798,9 @@  discard block
 block discarded – undo
798 798
  * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
799 799
  * @return string The link to the comments.
800 800
  */
801
-function get_comments_link( $post_id = 0 ) {
802
-	$hash = get_comments_number( $post_id ) ? '#comments' : '#respond';
803
-	$comments_link = get_permalink( $post_id ) . $hash;
801
+function get_comments_link($post_id = 0) {
802
+	$hash = get_comments_number($post_id) ? '#comments' : '#respond';
803
+	$comments_link = get_permalink($post_id).$hash;
804 804
 
805 805
 	/**
806 806
 	 * Filters the returned post comments permalink.
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 	 * @param string      $comments_link Post comments permalink with '#comments' appended.
811 811
 	 * @param int|WP_Post $post_id       Post ID or WP_Post object.
812 812
 	 */
813
-	return apply_filters( 'get_comments_link', $comments_link, $post_id );
813
+	return apply_filters('get_comments_link', $comments_link, $post_id);
814 814
 }
815 815
 
816 816
 /**
@@ -821,12 +821,12 @@  discard block
 block discarded – undo
821 821
  * @param string $deprecated   Not Used.
822 822
  * @param string $deprecated_2 Not Used.
823 823
  */
824
-function comments_link( $deprecated = '', $deprecated_2 = '' ) {
825
-	if ( !empty( $deprecated ) )
826
-		_deprecated_argument( __FUNCTION__, '0.72' );
827
-	if ( !empty( $deprecated_2 ) )
828
-		_deprecated_argument( __FUNCTION__, '1.3.0' );
829
-	echo esc_url( get_comments_link() );
824
+function comments_link($deprecated = '', $deprecated_2 = '') {
825
+	if ( ! empty($deprecated))
826
+		_deprecated_argument(__FUNCTION__, '0.72');
827
+	if ( ! empty($deprecated_2))
828
+		_deprecated_argument(__FUNCTION__, '1.3.0');
829
+	echo esc_url(get_comments_link());
830 830
 }
831 831
 
832 832
 /**
@@ -837,10 +837,10 @@  discard block
 block discarded – undo
837 837
  * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
838 838
  * @return int The number of comments a post has.
839 839
  */
840
-function get_comments_number( $post_id = 0 ) {
841
-	$post = get_post( $post_id );
840
+function get_comments_number($post_id = 0) {
841
+	$post = get_post($post_id);
842 842
 
843
-	if ( ! $post ) {
843
+	if ( ! $post) {
844 844
 		$count = 0;
845 845
 	} else {
846 846
 		$count = $post->comment_count;
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 	 * @param int $count   Number of comments a post has.
856 856
 	 * @param int $post_id Post ID.
857 857
 	 */
858
-	return apply_filters( 'get_comments_number', $count, $post_id );
858
+	return apply_filters('get_comments_number', $count, $post_id);
859 859
 }
860 860
 
861 861
 /**
@@ -868,11 +868,11 @@  discard block
 block discarded – undo
868 868
  * @param string $more       Optional. Text for more than one comment. Default false.
869 869
  * @param string $deprecated Not used.
870 870
  */
871
-function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
872
-	if ( ! empty( $deprecated ) ) {
873
-		_deprecated_argument( __FUNCTION__, '1.3.0' );
871
+function comments_number($zero = false, $one = false, $more = false, $deprecated = '') {
872
+	if ( ! empty($deprecated)) {
873
+		_deprecated_argument(__FUNCTION__, '1.3.0');
874 874
 	}
875
-	echo get_comments_number_text( $zero, $one, $more );
875
+	echo get_comments_number_text($zero, $one, $more);
876 876
 }
877 877
 
878 878
 /**
@@ -884,42 +884,42 @@  discard block
 block discarded – undo
884 884
  * @param string $one  Optional. Text for one comment. Default false.
885 885
  * @param string $more Optional. Text for more than one comment. Default false.
886 886
  */
887
-function get_comments_number_text( $zero = false, $one = false, $more = false ) {
887
+function get_comments_number_text($zero = false, $one = false, $more = false) {
888 888
 	$number = get_comments_number();
889 889
 
890
-	if ( $number > 1 ) {
891
-		if ( false === $more ) {
890
+	if ($number > 1) {
891
+		if (false === $more) {
892 892
 			/* translators: %s: number of comments */
893
-			$output = sprintf( _n( '%s Comment', '%s Comments', $number ), number_format_i18n( $number ) );
893
+			$output = sprintf(_n('%s Comment', '%s Comments', $number), number_format_i18n($number));
894 894
 		} else {
895 895
 			// % Comments
896 896
 			/* translators: If comment number in your language requires declension,
897 897
 			 * translate this to 'on'. Do not translate into your own language.
898 898
 			 */
899
-			if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) {
900
-				$text = preg_replace( '#<span class="screen-reader-text">.+?</span>#', '', $more );
901
-				$text = preg_replace( '/&.+?;/', '', $text ); // Kill entities
902
-				$text = trim( strip_tags( $text ), '% ' );
899
+			if ('on' === _x('off', 'Comment number declension: on or off')) {
900
+				$text = preg_replace('#<span class="screen-reader-text">.+?</span>#', '', $more);
901
+				$text = preg_replace('/&.+?;/', '', $text); // Kill entities
902
+				$text = trim(strip_tags($text), '% ');
903 903
 
904 904
 				// Replace '% Comments' with a proper plural form
905
-				if ( $text && ! preg_match( '/[0-9]+/', $text ) && false !== strpos( $more, '%' ) ) {
905
+				if ($text && ! preg_match('/[0-9]+/', $text) && false !== strpos($more, '%')) {
906 906
 					/* translators: %s: number of comments */
907
-					$new_text = _n( '%s Comment', '%s Comments', $number );
908
-					$new_text = trim( sprintf( $new_text, '' ) );
907
+					$new_text = _n('%s Comment', '%s Comments', $number);
908
+					$new_text = trim(sprintf($new_text, ''));
909 909
 
910
-					$more = str_replace( $text, $new_text, $more );
911
-					if ( false === strpos( $more, '%' ) ) {
912
-						$more = '% ' . $more;
910
+					$more = str_replace($text, $new_text, $more);
911
+					if (false === strpos($more, '%')) {
912
+						$more = '% '.$more;
913 913
 					}
914 914
 				}
915 915
 			}
916 916
 
917
-			$output = str_replace( '%', number_format_i18n( $number ), $more );
917
+			$output = str_replace('%', number_format_i18n($number), $more);
918 918
 		}
919
-	} elseif ( $number == 0 ) {
920
-		$output = ( false === $zero ) ? __( 'No Comments' ) : $zero;
919
+	} elseif ($number == 0) {
920
+		$output = (false === $zero) ? __('No Comments') : $zero;
921 921
 	} else { // must be one
922
-		$output = ( false === $one ) ? __( '1 Comment' ) : $one;
922
+		$output = (false === $one) ? __('1 Comment') : $one;
923 923
 	}
924 924
 	/**
925 925
 	 * Filters the comments count for display.
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 	 *                       is equal to 0, 1, or 1+.
933 933
 	 * @param int    $number The number of post comments.
934 934
 	 */
935
-	return apply_filters( 'comments_number', $output, $number );
935
+	return apply_filters('comments_number', $output, $number);
936 936
 }
937 937
 
938 938
 /**
@@ -948,8 +948,8 @@  discard block
 block discarded – undo
948 948
  * @param array           $args       Optional. An array of arguments. Default empty.
949 949
  * @return string The comment content.
950 950
  */
951
-function get_comment_text( $comment_ID = 0, $args = array() ) {
952
-	$comment = get_comment( $comment_ID );
951
+function get_comment_text($comment_ID = 0, $args = array()) {
952
+	$comment = get_comment($comment_ID);
953 953
 
954 954
 	/**
955 955
 	 * Filters the text of a comment.
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 	 * @param WP_Comment $comment         The comment object.
963 963
 	 * @param array      $args            An array of arguments.
964 964
 	 */
965
-	return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args );
965
+	return apply_filters('get_comment_text', $comment->comment_content, $comment, $args);
966 966
 }
967 967
 
968 968
 /**
@@ -977,10 +977,10 @@  discard block
 block discarded – undo
977 977
  *                                    Default current comment.
978 978
  * @param array           $args       Optional. An array of arguments. Default empty array. Default empty.
979 979
  */
980
-function comment_text( $comment_ID = 0, $args = array() ) {
981
-	$comment = get_comment( $comment_ID );
980
+function comment_text($comment_ID = 0, $args = array()) {
981
+	$comment = get_comment($comment_ID);
982 982
 
983
-	$comment_text = get_comment_text( $comment, $args );
983
+	$comment_text = get_comment_text($comment, $args);
984 984
 	/**
985 985
 	 * Filters the text of a comment to be displayed.
986 986
 	 *
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 	 * @param WP_Comment|null $comment      The comment object.
993 993
 	 * @param array           $args         An array of arguments.
994 994
 	 */
995
-	echo apply_filters( 'comment_text', $comment_text, $comment, $args );
995
+	echo apply_filters('comment_text', $comment_text, $comment, $args);
996 996
 }
997 997
 
998 998
 /**
@@ -1006,11 +1006,11 @@  discard block
 block discarded – undo
1006 1006
  *                          Default true.
1007 1007
  * @return string The formatted time.
1008 1008
  */
1009
-function get_comment_time( $d = '', $gmt = false, $translate = true ) {
1009
+function get_comment_time($d = '', $gmt = false, $translate = true) {
1010 1010
 	$comment = get_comment();
1011 1011
 
1012 1012
 	$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
1013
-	if ( '' == $d )
1013
+	if ('' == $d)
1014 1014
 		$date = mysql2date(get_option('time_format'), $comment_date, $translate);
1015 1015
 	else
1016 1016
 		$date = mysql2date($d, $comment_date, $translate);
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 	 * @param bool       $translate Whether the time is translated.
1027 1027
 	 * @param WP_Comment $comment   The comment object.
1028 1028
 	 */
1029
-	return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment );
1029
+	return apply_filters('get_comment_time', $date, $d, $gmt, $translate, $comment);
1030 1030
 }
1031 1031
 
1032 1032
 /**
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
  *
1037 1037
  * @param string $d Optional. The format of the time. Default user's settings.
1038 1038
  */
1039
-function comment_time( $d = '' ) {
1039
+function comment_time($d = '') {
1040 1040
 	echo get_comment_time($d);
1041 1041
 }
1042 1042
 
@@ -1050,9 +1050,9 @@  discard block
 block discarded – undo
1050 1050
  *                                   Default current comment.
1051 1051
  * @return string The comment type.
1052 1052
  */
1053
-function get_comment_type( $comment_ID = 0 ) {
1054
-	$comment = get_comment( $comment_ID );
1055
-	if ( '' == $comment->comment_type )
1053
+function get_comment_type($comment_ID = 0) {
1054
+	$comment = get_comment($comment_ID);
1055
+	if ('' == $comment->comment_type)
1056 1056
 		$comment->comment_type = 'comment';
1057 1057
 
1058 1058
 	/**
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 	 * @param int 	     $comment_ID   The comment ID.
1066 1066
 	 * @param WP_Comment $comment      The comment object.
1067 1067
 	 */
1068
-	return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
1068
+	return apply_filters('get_comment_type', $comment->comment_type, $comment->comment_ID, $comment);
1069 1069
 }
1070 1070
 
1071 1071
 /**
@@ -1077,12 +1077,12 @@  discard block
 block discarded – undo
1077 1077
  * @param string $trackbacktxt Optional. String to display for trackback type. Default false.
1078 1078
  * @param string $pingbacktxt  Optional. String to display for pingback type. Default false.
1079 1079
  */
1080
-function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {
1081
-	if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );
1082
-	if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );
1083
-	if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );
1080
+function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) {
1081
+	if (false === $commenttxt) $commenttxt = _x('Comment', 'noun');
1082
+	if (false === $trackbacktxt) $trackbacktxt = __('Trackback');
1083
+	if (false === $pingbacktxt) $pingbacktxt = __('Pingback');
1084 1084
 	$type = get_comment_type();
1085
-	switch( $type ) {
1085
+	switch ($type) {
1086 1086
 		case 'trackback' :
1087 1087
 			echo $trackbacktxt;
1088 1088
 			break;
@@ -1106,10 +1106,10 @@  discard block
 block discarded – undo
1106 1106
  * @return string The trackback URL after being filtered.
1107 1107
  */
1108 1108
 function get_trackback_url() {
1109
-	if ( '' != get_option('permalink_structure') )
1110
-		$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
1109
+	if ('' != get_option('permalink_structure'))
1110
+		$tb_url = trailingslashit(get_permalink()).user_trailingslashit('trackback', 'single_trackback');
1111 1111
 	else
1112
-		$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
1112
+		$tb_url = get_option('siteurl').'/wp-trackback.php?p='.get_the_ID();
1113 1113
 
1114 1114
 	/**
1115 1115
 	 * Filters the returned trackback URL.
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
 	 *
1119 1119
 	 * @param string $tb_url The trackback URL.
1120 1120
 	 */
1121
-	return apply_filters( 'trackback_url', $tb_url );
1121
+	return apply_filters('trackback_url', $tb_url);
1122 1122
 }
1123 1123
 
1124 1124
 /**
@@ -1130,17 +1130,17 @@  discard block
 block discarded – undo
1130 1130
  * @return void|string Should only be used to echo the trackback URL, use get_trackback_url()
1131 1131
  *                     for the result instead.
1132 1132
  */
1133
-function trackback_url( $deprecated_echo = true ) {
1134
-	if ( true !== $deprecated_echo ) {
1135
-		_deprecated_argument( __FUNCTION__, '2.5.0',
1133
+function trackback_url($deprecated_echo = true) {
1134
+	if (true !== $deprecated_echo) {
1135
+		_deprecated_argument(__FUNCTION__, '2.5.0',
1136 1136
 			/* translators: %s: get_trackback_url() */
1137
-			sprintf( __( 'Use %s instead if you do not want the value echoed.' ),
1137
+			sprintf(__('Use %s instead if you do not want the value echoed.'),
1138 1138
 				'<code>get_trackback_url()</code>'
1139 1139
 			)
1140 1140
 		);
1141 1141
 	}
1142 1142
 
1143
-	if ( $deprecated_echo ) {
1143
+	if ($deprecated_echo) {
1144 1144
 		echo get_trackback_url();
1145 1145
 	} else {
1146 1146
 		return get_trackback_url();
@@ -1156,12 +1156,12 @@  discard block
 block discarded – undo
1156 1156
  *
1157 1157
  * @param int $deprecated Not used (Was $timezone = 0).
1158 1158
  */
1159
-function trackback_rdf( $deprecated = '' ) {
1160
-	if ( ! empty( $deprecated ) ) {
1161
-		_deprecated_argument( __FUNCTION__, '2.5.0' );
1159
+function trackback_rdf($deprecated = '') {
1160
+	if ( ! empty($deprecated)) {
1161
+		_deprecated_argument(__FUNCTION__, '2.5.0');
1162 1162
 	}
1163 1163
 
1164
-	if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && false !== stripos( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) ) {
1164
+	if (isset($_SERVER['HTTP_USER_AGENT']) && false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
1165 1165
 		return;
1166 1166
 	}
1167 1167
 
@@ -1187,12 +1187,12 @@  discard block
 block discarded – undo
1187 1187
  * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
1188 1188
  * @return bool True if the comments are open.
1189 1189
  */
1190
-function comments_open( $post_id = null ) {
1190
+function comments_open($post_id = null) {
1191 1191
 
1192 1192
 	$_post = get_post($post_id);
1193 1193
 
1194 1194
 	$post_id = $_post ? $_post->ID : 0;
1195
-	$open = ( 'open' == $_post->comment_status );
1195
+	$open = ('open' == $_post->comment_status);
1196 1196
 
1197 1197
 	/**
1198 1198
 	 * Filters whether the current post is open for comments.
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
 	 * @param bool $open    Whether the current post is open for comments.
1203 1203
 	 * @param int  $post_id The post ID.
1204 1204
 	 */
1205
-	return apply_filters( 'comments_open', $open, $post_id );
1205
+	return apply_filters('comments_open', $open, $post_id);
1206 1206
 }
1207 1207
 
1208 1208
 /**
@@ -1213,12 +1213,12 @@  discard block
 block discarded – undo
1213 1213
  * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
1214 1214
  * @return bool True if pings are accepted
1215 1215
  */
1216
-function pings_open( $post_id = null ) {
1216
+function pings_open($post_id = null) {
1217 1217
 
1218 1218
 	$_post = get_post($post_id);
1219 1219
 
1220 1220
 	$post_id = $_post ? $_post->ID : 0;
1221
-	$open = ( 'open' == $_post->ping_status );
1221
+	$open = ('open' == $_post->ping_status);
1222 1222
 
1223 1223
 	/**
1224 1224
 	 * Filters whether the current post is open for pings.
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 	 * @param bool $open    Whether the current post is open for pings.
1229 1229
 	 * @param int  $post_id The post ID.
1230 1230
 	 */
1231
-	return apply_filters( 'pings_open', $open, $post_id );
1231
+	return apply_filters('pings_open', $open, $post_id);
1232 1232
 }
1233 1233
 
1234 1234
 /**
@@ -1249,8 +1249,8 @@  discard block
 block discarded – undo
1249 1249
 	$post = get_post();
1250 1250
 	$post_id = $post ? $post->ID : 0;
1251 1251
 
1252
-	if ( current_user_can( 'unfiltered_html' ) ) {
1253
-		wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false );
1252
+	if (current_user_can('unfiltered_html')) {
1253
+		wp_nonce_field('unfiltered-html-comment_'.$post_id, '_wp_unfiltered_html_comment_disabled', false);
1254 1254
 		echo "<script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script>\n";
1255 1255
 	}
1256 1256
 }
@@ -1290,13 +1290,13 @@  discard block
 block discarded – undo
1290 1290
  * @param bool   $separate_comments Optional. Whether to separate the comments by comment type.
1291 1291
  *                                  Default false.
1292 1292
  */
1293
-function comments_template( $file = '/comments.php', $separate_comments = false ) {
1293
+function comments_template($file = '/comments.php', $separate_comments = false) {
1294 1294
 	global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
1295 1295
 
1296
-	if ( !(is_single() || is_page() || $withcomments) || empty($post) )
1296
+	if ( ! (is_single() || is_page() || $withcomments) || empty($post))
1297 1297
 		return;
1298 1298
 
1299
-	if ( empty($file) )
1299
+	if (empty($file))
1300 1300
 		$file = '/comments.php';
1301 1301
 
1302 1302
 	$req = get_option('require_name_email');
@@ -1332,31 +1332,31 @@  discard block
 block discarded – undo
1332 1332
 		'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
1333 1333
 	);
1334 1334
 
1335
-	if ( get_option('thread_comments') ) {
1335
+	if (get_option('thread_comments')) {
1336 1336
 		$comment_args['hierarchical'] = 'threaded';
1337 1337
 	} else {
1338 1338
 		$comment_args['hierarchical'] = false;
1339 1339
 	}
1340 1340
 
1341
-	if ( $user_ID ) {
1342
-		$comment_args['include_unapproved'] = array( $user_ID );
1343
-	} elseif ( ! empty( $comment_author_email ) ) {
1344
-		$comment_args['include_unapproved'] = array( $comment_author_email );
1341
+	if ($user_ID) {
1342
+		$comment_args['include_unapproved'] = array($user_ID);
1343
+	} elseif ( ! empty($comment_author_email)) {
1344
+		$comment_args['include_unapproved'] = array($comment_author_email);
1345 1345
 	}
1346 1346
 
1347 1347
 	$per_page = 0;
1348
-	if ( get_option( 'page_comments' ) ) {
1349
-		$per_page = (int) get_query_var( 'comments_per_page' );
1350
-		if ( 0 === $per_page ) {
1351
-			$per_page = (int) get_option( 'comments_per_page' );
1348
+	if (get_option('page_comments')) {
1349
+		$per_page = (int) get_query_var('comments_per_page');
1350
+		if (0 === $per_page) {
1351
+			$per_page = (int) get_option('comments_per_page');
1352 1352
 		}
1353 1353
 
1354 1354
 		$comment_args['number'] = $per_page;
1355
-		$page = (int) get_query_var( 'cpage' );
1355
+		$page = (int) get_query_var('cpage');
1356 1356
 
1357
-		if ( $page ) {
1358
-			$comment_args['offset'] = ( $page - 1 ) * $per_page;
1359
-		} elseif ( 'oldest' === get_option( 'default_comments_page' ) ) {
1357
+		if ($page) {
1358
+			$comment_args['offset'] = ($page - 1) * $per_page;
1359
+		} elseif ('oldest' === get_option('default_comments_page')) {
1360 1360
 			$comment_args['offset'] = 0;
1361 1361
 		} else {
1362 1362
 			// If fetching the first page of 'newest', we need a top-level comment count.
@@ -1368,17 +1368,17 @@  discard block
 block discarded – undo
1368 1368
 				'status'  => 'approve',
1369 1369
 			);
1370 1370
 
1371
-			if ( $comment_args['hierarchical'] ) {
1371
+			if ($comment_args['hierarchical']) {
1372 1372
 				$top_level_args['parent'] = 0;
1373 1373
 			}
1374 1374
 
1375
-			if ( isset( $comment_args['include_unapproved'] ) ) {
1375
+			if (isset($comment_args['include_unapproved'])) {
1376 1376
 				$top_level_args['include_unapproved'] = $comment_args['include_unapproved'];
1377 1377
 			}
1378 1378
 
1379
-			$top_level_count = $top_level_query->query( $top_level_args );
1379
+			$top_level_count = $top_level_query->query($top_level_args);
1380 1380
 
1381
-			$comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
1381
+			$comment_args['offset'] = (ceil($top_level_count / $per_page) - 1) * $per_page;
1382 1382
 		}
1383 1383
 	}
1384 1384
 
@@ -1405,22 +1405,22 @@  discard block
 block discarded – undo
1405 1405
 	 *     @type int          $number                    Number of comments to fetch.
1406 1406
 	 * }
1407 1407
 	 */
1408
-	$comment_args = apply_filters( 'comments_template_query_args', $comment_args );
1409
-	$comment_query = new WP_Comment_Query( $comment_args );
1408
+	$comment_args = apply_filters('comments_template_query_args', $comment_args);
1409
+	$comment_query = new WP_Comment_Query($comment_args);
1410 1410
 	$_comments = $comment_query->comments;
1411 1411
 
1412 1412
 	// Trees must be flattened before they're passed to the walker.
1413
-	if ( $comment_args['hierarchical'] ) {
1413
+	if ($comment_args['hierarchical']) {
1414 1414
 		$comments_flat = array();
1415
-		foreach ( $_comments as $_comment ) {
1415
+		foreach ($_comments as $_comment) {
1416 1416
 			$comments_flat[]  = $_comment;
1417
-			$comment_children = $_comment->get_children( array(
1417
+			$comment_children = $_comment->get_children(array(
1418 1418
 				'format' => 'flat',
1419 1419
 				'status' => $comment_args['status'],
1420 1420
 				'orderby' => $comment_args['orderby']
1421
-			) );
1421
+			));
1422 1422
 
1423
-			foreach ( $comment_children as $comment_child ) {
1423
+			foreach ($comment_children as $comment_child) {
1424 1424
 				$comments_flat[] = $comment_child;
1425 1425
 			}
1426 1426
 		}
@@ -1436,13 +1436,13 @@  discard block
 block discarded – undo
1436 1436
 	 * @param array $comments Array of comments supplied to the comments template.
1437 1437
 	 * @param int   $post_ID  Post ID.
1438 1438
 	 */
1439
-	$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
1439
+	$wp_query->comments = apply_filters('comments_array', $comments_flat, $post->ID);
1440 1440
 
1441 1441
 	$comments = &$wp_query->comments;
1442 1442
 	$wp_query->comment_count = count($wp_query->comments);
1443 1443
 	$wp_query->max_num_comment_pages = $comment_query->max_num_pages;
1444 1444
 
1445
-	if ( $separate_comments ) {
1445
+	if ($separate_comments) {
1446 1446
 		$wp_query->comments_by_type = separate_comments($comments);
1447 1447
 		$comments_by_type = &$wp_query->comments_by_type;
1448 1448
 	} else {
@@ -1450,15 +1450,15 @@  discard block
 block discarded – undo
1450 1450
 	}
1451 1451
 
1452 1452
 	$overridden_cpage = false;
1453
-	if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) {
1454
-		set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
1453
+	if ('' == get_query_var('cpage') && $wp_query->max_num_comment_pages > 1) {
1454
+		set_query_var('cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1);
1455 1455
 		$overridden_cpage = true;
1456 1456
 	}
1457 1457
 
1458
-	if ( !defined('COMMENTS_TEMPLATE') )
1458
+	if ( ! defined('COMMENTS_TEMPLATE'))
1459 1459
 		define('COMMENTS_TEMPLATE', true);
1460 1460
 
1461
-	$theme_template = STYLESHEETPATH . $file;
1461
+	$theme_template = STYLESHEETPATH.$file;
1462 1462
 	/**
1463 1463
 	 * Filters the path to the theme template file used for the comments template.
1464 1464
 	 *
@@ -1466,13 +1466,13 @@  discard block
 block discarded – undo
1466 1466
 	 *
1467 1467
 	 * @param string $theme_template The path to the theme template file.
1468 1468
 	 */
1469
-	$include = apply_filters( 'comments_template', $theme_template );
1470
-	if ( file_exists( $include ) )
1471
-		require( $include );
1472
-	elseif ( file_exists( TEMPLATEPATH . $file ) )
1473
-		require( TEMPLATEPATH . $file );
1469
+	$include = apply_filters('comments_template', $theme_template);
1470
+	if (file_exists($include))
1471
+		require($include);
1472
+	elseif (file_exists(TEMPLATEPATH.$file))
1473
+		require(TEMPLATEPATH.$file);
1474 1474
 	else // Backward compat code will be removed in a future release
1475
-		require( ABSPATH . WPINC . '/theme-compat/comments.php');
1475
+		require(ABSPATH.WPINC.'/theme-compat/comments.php');
1476 1476
 }
1477 1477
 
1478 1478
 /**
@@ -1489,45 +1489,45 @@  discard block
 block discarded – undo
1489 1489
  * @param string $none      Optional. String to display when comments have been turned off.
1490 1490
  *                          Default false.
1491 1491
  */
1492
-function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
1492
+function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false) {
1493 1493
 	$id = get_the_ID();
1494 1494
 	$title = get_the_title();
1495
-	$number = get_comments_number( $id );
1495
+	$number = get_comments_number($id);
1496 1496
 
1497
-	if ( false === $zero ) {
1497
+	if (false === $zero) {
1498 1498
 		/* translators: %s: post title */
1499
-		$zero = sprintf( __( 'No Comments<span class="screen-reader-text"> on %s</span>' ), $title );
1499
+		$zero = sprintf(__('No Comments<span class="screen-reader-text"> on %s</span>'), $title);
1500 1500
 	}
1501 1501
 
1502
-	if ( false === $one ) {
1502
+	if (false === $one) {
1503 1503
 		/* translators: %s: post title */
1504
-		$one = sprintf( __( '1 Comment<span class="screen-reader-text"> on %s</span>' ), $title );
1504
+		$one = sprintf(__('1 Comment<span class="screen-reader-text"> on %s</span>'), $title);
1505 1505
 	}
1506 1506
 
1507
-	if ( false === $more ) {
1507
+	if (false === $more) {
1508 1508
 		/* translators: 1: Number of comments 2: post title */
1509
-		$more = _n( '%1$s Comment<span class="screen-reader-text"> on %2$s</span>', '%1$s Comments<span class="screen-reader-text"> on %2$s</span>', $number );
1510
-		$more = sprintf( $more, number_format_i18n( $number ), $title );
1509
+		$more = _n('%1$s Comment<span class="screen-reader-text"> on %2$s</span>', '%1$s Comments<span class="screen-reader-text"> on %2$s</span>', $number);
1510
+		$more = sprintf($more, number_format_i18n($number), $title);
1511 1511
 	}
1512 1512
 
1513
-	if ( false === $none ) {
1513
+	if (false === $none) {
1514 1514
 		/* translators: %s: post title */
1515
-		$none = sprintf( __( 'Comments Off<span class="screen-reader-text"> on %s</span>' ), $title );
1515
+		$none = sprintf(__('Comments Off<span class="screen-reader-text"> on %s</span>'), $title);
1516 1516
 	}
1517 1517
 
1518
-	if ( 0 == $number && !comments_open() && !pings_open() ) {
1519
-		echo '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
1518
+	if (0 == $number && ! comments_open() && ! pings_open()) {
1519
+		echo '<span'.(( ! empty($css_class)) ? ' class="'.esc_attr($css_class).'"' : '').'>'.$none.'</span>';
1520 1520
 		return;
1521 1521
 	}
1522 1522
 
1523
-	if ( post_password_required() ) {
1524
-		_e( 'Enter your password to view comments.' );
1523
+	if (post_password_required()) {
1524
+		_e('Enter your password to view comments.');
1525 1525
 		return;
1526 1526
 	}
1527 1527
 
1528 1528
 	echo '<a href="';
1529
-	if ( 0 == $number ) {
1530
-		$respond_link = get_permalink() . '#respond';
1529
+	if (0 == $number) {
1530
+		$respond_link = get_permalink().'#respond';
1531 1531
 		/**
1532 1532
 		 * Filters the respond link when a post has no comments.
1533 1533
 		 *
@@ -1536,13 +1536,13 @@  discard block
 block discarded – undo
1536 1536
 		 * @param string $respond_link The default response link.
1537 1537
 		 * @param integer $id The post ID.
1538 1538
 		 */
1539
-		echo apply_filters( 'respond_link', $respond_link, $id );
1539
+		echo apply_filters('respond_link', $respond_link, $id);
1540 1540
 	} else {
1541 1541
 		comments_link();
1542 1542
 	}
1543 1543
 	echo '"';
1544 1544
 
1545
-	if ( !empty( $css_class ) ) {
1545
+	if ( ! empty($css_class)) {
1546 1546
 		echo ' class="'.$css_class.'" ';
1547 1547
 	}
1548 1548
 
@@ -1554,10 +1554,10 @@  discard block
 block discarded – undo
1554 1554
 	 *
1555 1555
 	 * @param string $attributes The comments link attributes. Default empty.
1556 1556
 	 */
1557
-	echo apply_filters( 'comments_popup_link_attributes', $attributes );
1557
+	echo apply_filters('comments_popup_link_attributes', $attributes);
1558 1558
 
1559 1559
 	echo '>';
1560
-	comments_number( $zero, $one, $more );
1560
+	comments_number($zero, $one, $more);
1561 1561
 	echo '</a>';
1562 1562
 }
1563 1563
 
@@ -1589,35 +1589,35 @@  discard block
 block discarded – undo
1589 1589
  *                                Default current post.
1590 1590
  * @return void|false|string Link to show comment form, if successful. False, if comments are closed.
1591 1591
  */
1592
-function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
1592
+function get_comment_reply_link($args = array(), $comment = null, $post = null) {
1593 1593
 	$defaults = array(
1594 1594
 		'add_below'     => 'comment',
1595 1595
 		'respond_id'    => 'respond',
1596
-		'reply_text'    => __( 'Reply' ),
1596
+		'reply_text'    => __('Reply'),
1597 1597
 		/* translators: Comment reply button text. 1: Comment author name */
1598
-		'reply_to_text' => __( 'Reply to %s' ),
1599
-		'login_text'    => __( 'Log in to Reply' ),
1598
+		'reply_to_text' => __('Reply to %s'),
1599
+		'login_text'    => __('Log in to Reply'),
1600 1600
 		'max_depth'     => 0,
1601 1601
 		'depth'         => 0,
1602 1602
 		'before'        => '',
1603 1603
 		'after'         => ''
1604 1604
 	);
1605 1605
 
1606
-	$args = wp_parse_args( $args, $defaults );
1606
+	$args = wp_parse_args($args, $defaults);
1607 1607
 
1608
-	if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
1608
+	if (0 == $args['depth'] || $args['max_depth'] <= $args['depth']) {
1609 1609
 		return;
1610 1610
 	}
1611 1611
 
1612
-	$comment = get_comment( $comment );
1612
+	$comment = get_comment($comment);
1613 1613
 
1614
-	if ( empty( $post ) ) {
1614
+	if (empty($post)) {
1615 1615
 		$post = $comment->comment_post_ID;
1616 1616
 	}
1617 1617
 
1618
-	$post = get_post( $post );
1618
+	$post = get_post($post);
1619 1619
 
1620
-	if ( ! comments_open( $post->ID ) ) {
1620
+	if ( ! comments_open($post->ID)) {
1621 1621
 		return false;
1622 1622
 	}
1623 1623
 
@@ -1631,22 +1631,22 @@  discard block
 block discarded – undo
1631 1631
 	 * @param WP_Comment $comment The object of the comment being replied to.
1632 1632
 	 * @param WP_Post    $post    The WP_Post object.
1633 1633
 	 */
1634
-	$args = apply_filters( 'comment_reply_link_args', $args, $comment, $post );
1634
+	$args = apply_filters('comment_reply_link_args', $args, $comment, $post);
1635 1635
 
1636
-	if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
1637
-		$link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
1638
-			esc_url( wp_login_url( get_permalink() ) ),
1636
+	if (get_option('comment_registration') && ! is_user_logged_in()) {
1637
+		$link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
1638
+			esc_url(wp_login_url(get_permalink())),
1639 1639
 			$args['login_text']
1640 1640
 		);
1641 1641
 	} else {
1642
-		$onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )',
1642
+		$onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )',
1643 1643
 			$args['add_below'], $comment->comment_ID, $args['respond_id'], $post->ID
1644 1644
 		);
1645 1645
 
1646
-		$link = sprintf( "<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
1647
-			esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'],
1646
+		$link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
1647
+			esc_url(add_query_arg('replytocom', $comment->comment_ID, get_permalink($post->ID)))."#".$args['respond_id'],
1648 1648
 			$onclick,
1649
-			esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
1649
+			esc_attr(sprintf($args['reply_to_text'], $comment->comment_author)),
1650 1650
 			$args['reply_text']
1651 1651
 		);
1652 1652
 	}
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
 	 * @param object  $comment The object of the comment being replied.
1662 1662
 	 * @param WP_Post $post    The WP_Post object.
1663 1663
 	 */
1664
-	return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );
1664
+	return apply_filters('comment_reply_link', $args['before'].$link.$args['after'], $args, $comment, $post);
1665 1665
 }
1666 1666
 
1667 1667
 /**
@@ -1718,27 +1718,27 @@  discard block
 block discarded – undo
1718 1718
 
1719 1719
 	$post = get_post($post);
1720 1720
 
1721
-	if ( ! comments_open( $post->ID ) ) {
1721
+	if ( ! comments_open($post->ID)) {
1722 1722
 		return false;
1723 1723
 	}
1724 1724
 
1725
-	if ( get_option('comment_registration') && ! is_user_logged_in() ) {
1726
-		$link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
1727
-			wp_login_url( get_permalink() ),
1725
+	if (get_option('comment_registration') && ! is_user_logged_in()) {
1726
+		$link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
1727
+			wp_login_url(get_permalink()),
1728 1728
 			$args['login_text']
1729 1729
 		);
1730 1730
 	} else {
1731
-		$onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )',
1731
+		$onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )',
1732 1732
 			$args['add_below'], $post->ID, $args['respond_id']
1733 1733
 		);
1734 1734
 
1735
-		$link = sprintf( "<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>",
1736
-			get_permalink( $post->ID ) . '#' . $args['respond_id'],
1735
+		$link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>",
1736
+			get_permalink($post->ID).'#'.$args['respond_id'],
1737 1737
 			$onclick,
1738 1738
 			$args['reply_text']
1739 1739
 		);
1740 1740
 	}
1741
-	$formatted_link = $args['before'] . $link . $args['after'];
1741
+	$formatted_link = $args['before'].$link.$args['after'];
1742 1742
 
1743 1743
 	/**
1744 1744
 	 * Filters the formatted post comments link HTML.
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
 	 * @param string      $formatted The HTML-formatted post comments link.
1749 1749
 	 * @param int|WP_Post $post      The post ID or WP_Post object.
1750 1750
 	 */
1751
-	return apply_filters( 'post_comments_link', $formatted_link, $post );
1751
+	return apply_filters('post_comments_link', $formatted_link, $post);
1752 1752
 }
1753 1753
 
1754 1754
 /**
@@ -1775,14 +1775,14 @@  discard block
 block discarded – undo
1775 1775
  * @param string $text Optional. Text to display for cancel reply link. Default empty.
1776 1776
  * @return string
1777 1777
  */
1778
-function get_cancel_comment_reply_link( $text = '' ) {
1779
-	if ( empty($text) )
1778
+function get_cancel_comment_reply_link($text = '') {
1779
+	if (empty($text))
1780 1780
 		$text = __('Click here to cancel reply.');
1781 1781
 
1782 1782
 	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
1783
-	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
1783
+	$link = esc_html(remove_query_arg('replytocom')).'#respond';
1784 1784
 
1785
-	$formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
1785
+	$formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="'.$link.'"'.$style.'>'.$text.'</a>';
1786 1786
 
1787 1787
 	/**
1788 1788
 	 * Filters the cancel comment reply link HTML.
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
 	 * @param string $link           Cancel comment reply link URL.
1794 1794
 	 * @param string $text           Cancel comment reply link text.
1795 1795
 	 */
1796
-	return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );
1796
+	return apply_filters('cancel_comment_reply_link', $formatted_link, $link, $text);
1797 1797
 }
1798 1798
 
1799 1799
 /**
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
  *
1804 1804
  * @param string $text Optional. Text to display for cancel reply link. Default empty.
1805 1805
  */
1806
-function cancel_comment_reply_link( $text = '' ) {
1806
+function cancel_comment_reply_link($text = '') {
1807 1807
 	echo get_cancel_comment_reply_link($text);
1808 1808
 }
1809 1809
 
@@ -1815,8 +1815,8 @@  discard block
 block discarded – undo
1815 1815
  * @param int $id Optional. Post ID. Default current post ID.
1816 1816
  * @return string Hidden input HTML for replying to comments
1817 1817
  */
1818
-function get_comment_id_fields( $id = 0 ) {
1819
-	if ( empty( $id ) )
1818
+function get_comment_id_fields($id = 0) {
1819
+	if (empty($id))
1820 1820
 		$id = get_the_ID();
1821 1821
 
1822 1822
 	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
@@ -1832,7 +1832,7 @@  discard block
 block discarded – undo
1832 1832
 	 * @param int    $id        The post ID.
1833 1833
 	 * @param int    $replytoid The id of the comment being replied to.
1834 1834
 	 */
1835
-	return apply_filters( 'comment_id_fields', $result, $id, $replytoid );
1835
+	return apply_filters('comment_id_fields', $result, $id, $replytoid);
1836 1836
 }
1837 1837
 
1838 1838
 /**
@@ -1842,8 +1842,8 @@  discard block
 block discarded – undo
1842 1842
  *
1843 1843
  * @param int $id Optional. Post ID. Default current post ID.
1844 1844
  */
1845
-function comment_id_fields( $id = 0 ) {
1846
-	echo get_comment_id_fields( $id );
1845
+function comment_id_fields($id = 0) {
1846
+	echo get_comment_id_fields($id);
1847 1847
 }
1848 1848
 
1849 1849
 /**
@@ -1866,21 +1866,21 @@  discard block
 block discarded – undo
1866 1866
  * @param string $linktoparent Optional. Boolean to control making the author's name a link
1867 1867
  *                             to their comment. Default true.
1868 1868
  */
1869
-function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
1869
+function comment_form_title($noreplytext = false, $replytext = false, $linktoparent = true) {
1870 1870
 	global $comment;
1871 1871
 
1872
-	if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
1873
-	if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
1872
+	if (false === $noreplytext) $noreplytext = __('Leave a Reply');
1873
+	if (false === $replytext) $replytext = __('Leave a Reply to %s');
1874 1874
 
1875 1875
 	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
1876 1876
 
1877
-	if ( 0 == $replytoid )
1877
+	if (0 == $replytoid)
1878 1878
 		echo $noreplytext;
1879 1879
 	else {
1880 1880
 		// Sets the global so that template tags can be used in the comment form.
1881 1881
 		$comment = get_comment($replytoid);
1882
-		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author( $comment ) . '</a>' : get_comment_author( $comment );
1883
-		printf( $replytext, $author );
1882
+		$author = ($linktoparent) ? '<a href="#comment-'.get_comment_ID().'">'.get_comment_author($comment).'</a>' : get_comment_author($comment);
1883
+		printf($replytext, $author);
1884 1884
 	}
1885 1885
 }
1886 1886
 
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
  * }
1923 1923
  * @param array $comments Optional. Array of WP_Comment objects.
1924 1924
  */
1925
-function wp_list_comments( $args = array(), $comments = null ) {
1925
+function wp_list_comments($args = array(), $comments = null) {
1926 1926
 	global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
1927 1927
 
1928 1928
 	$in_comment_loop = true;
@@ -1942,12 +1942,12 @@  discard block
 block discarded – undo
1942 1942
 		'avatar_size'       => 32,
1943 1943
 		'reverse_top_level' => null,
1944 1944
 		'reverse_children'  => '',
1945
-		'format'            => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml',
1945
+		'format'            => current_theme_supports('html5', 'comment-list') ? 'html5' : 'xhtml',
1946 1946
 		'short_ping'        => false,
1947 1947
 		'echo'              => true,
1948 1948
 	);
1949 1949
 
1950
-	$r = wp_parse_args( $args, $defaults );
1950
+	$r = wp_parse_args($args, $defaults);
1951 1951
 
1952 1952
 	/**
1953 1953
 	 * Filters the arguments used in retrieving the comment list.
@@ -1958,16 +1958,16 @@  discard block
 block discarded – undo
1958 1958
 	 *
1959 1959
 	 * @param array $r An array of arguments for displaying comments.
1960 1960
 	 */
1961
-	$r = apply_filters( 'wp_list_comments_args', $r );
1961
+	$r = apply_filters('wp_list_comments_args', $r);
1962 1962
 
1963 1963
 	// Figure out what comments we'll be looping through ($_comments)
1964
-	if ( null !== $comments ) {
1964
+	if (null !== $comments) {
1965 1965
 		$comments = (array) $comments;
1966
-		if ( empty($comments) )
1966
+		if (empty($comments))
1967 1967
 			return;
1968
-		if ( 'all' != $r['type'] ) {
1968
+		if ('all' != $r['type']) {
1969 1969
 			$comments_by_type = separate_comments($comments);
1970
-			if ( empty($comments_by_type[$r['type']]) )
1970
+			if (empty($comments_by_type[$r['type']]))
1971 1971
 				return;
1972 1972
 			$_comments = $comments_by_type[$r['type']];
1973 1973
 		} else {
@@ -1978,14 +1978,14 @@  discard block
 block discarded – undo
1978 1978
 		 * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
1979 1979
 		 * perform a separate comment query and allow Walker_Comment to paginate.
1980 1980
 		 */
1981
-		if ( $r['page'] || $r['per_page'] ) {
1982
-			$current_cpage = get_query_var( 'cpage' );
1983
-			if ( ! $current_cpage ) {
1984
-				$current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
1981
+		if ($r['page'] || $r['per_page']) {
1982
+			$current_cpage = get_query_var('cpage');
1983
+			if ( ! $current_cpage) {
1984
+				$current_cpage = 'newest' === get_option('default_comments_page') ? 1 : $wp_query->max_num_comment_pages;
1985 1985
 			}
1986 1986
 
1987
-			$current_per_page = get_query_var( 'comments_per_page' );
1988
-			if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
1987
+			$current_per_page = get_query_var('comments_per_page');
1988
+			if ($r['page'] != $current_cpage || $r['per_page'] != $current_per_page) {
1989 1989
 				$comment_args = array(
1990 1990
 					'post_id' => get_the_ID(),
1991 1991
 					'orderby' => 'comment_date_gmt',
@@ -1993,24 +1993,24 @@  discard block
 block discarded – undo
1993 1993
 					'status' => 'approve',
1994 1994
 				);
1995 1995
 
1996
-				if ( is_user_logged_in() ) {
1996
+				if (is_user_logged_in()) {
1997 1997
 					$comment_args['include_unapproved'] = get_current_user_id();
1998 1998
 				} else {
1999 1999
 					$commenter = wp_get_current_commenter();
2000
-					if ( $commenter['comment_author_email'] ) {
2000
+					if ($commenter['comment_author_email']) {
2001 2001
 						$comment_args['include_unapproved'] = $commenter['comment_author_email'];
2002 2002
 					}
2003 2003
 				}
2004 2004
 
2005
-				$comments = get_comments( $comment_args );
2005
+				$comments = get_comments($comment_args);
2006 2006
 
2007
-				if ( 'all' != $r['type'] ) {
2008
-					$comments_by_type = separate_comments( $comments );
2009
-					if ( empty( $comments_by_type[ $r['type'] ] ) ) {
2007
+				if ('all' != $r['type']) {
2008
+					$comments_by_type = separate_comments($comments);
2009
+					if (empty($comments_by_type[$r['type']])) {
2010 2010
 						return;
2011 2011
 					}
2012 2012
 
2013
-					$_comments = $comments_by_type[ $r['type'] ];
2013
+					$_comments = $comments_by_type[$r['type']];
2014 2014
 				} else {
2015 2015
 					$_comments = $comments;
2016 2016
 				}
@@ -2018,29 +2018,29 @@  discard block
 block discarded – undo
2018 2018
 
2019 2019
 		// Otherwise, fall back on the comments from `$wp_query->comments`.
2020 2020
 		} else {
2021
-			if ( empty($wp_query->comments) )
2021
+			if (empty($wp_query->comments))
2022 2022
 				return;
2023
-			if ( 'all' != $r['type'] ) {
2024
-				if ( empty($wp_query->comments_by_type) )
2023
+			if ('all' != $r['type']) {
2024
+				if (empty($wp_query->comments_by_type))
2025 2025
 					$wp_query->comments_by_type = separate_comments($wp_query->comments);
2026
-				if ( empty($wp_query->comments_by_type[$r['type']]) )
2026
+				if (empty($wp_query->comments_by_type[$r['type']]))
2027 2027
 					return;
2028 2028
 				$_comments = $wp_query->comments_by_type[$r['type']];
2029 2029
 			} else {
2030 2030
 				$_comments = $wp_query->comments;
2031 2031
 			}
2032 2032
 
2033
-			if ( $wp_query->max_num_comment_pages ) {
2034
-				$default_comments_page = get_option( 'default_comments_page' );
2035
-				$cpage = get_query_var( 'cpage' );
2036
-				if ( 'newest' === $default_comments_page ) {
2033
+			if ($wp_query->max_num_comment_pages) {
2034
+				$default_comments_page = get_option('default_comments_page');
2035
+				$cpage = get_query_var('cpage');
2036
+				if ('newest' === $default_comments_page) {
2037 2037
 					$r['cpage'] = $cpage;
2038 2038
 
2039 2039
 				/*
2040 2040
 				 * When first page shows oldest comments, post permalink is the same as
2041 2041
 				 * the comment permalink.
2042 2042
 				 */
2043
-				} elseif ( $cpage == 1 ) {
2043
+				} elseif ($cpage == 1) {
2044 2044
 					$r['cpage'] = '';
2045 2045
 				} else {
2046 2046
 					$r['cpage'] = $cpage;
@@ -2052,52 +2052,52 @@  discard block
 block discarded – undo
2052 2052
 		}
2053 2053
 	}
2054 2054
 
2055
-	if ( '' === $r['per_page'] && get_option( 'page_comments' ) ) {
2055
+	if ('' === $r['per_page'] && get_option('page_comments')) {
2056 2056
 		$r['per_page'] = get_query_var('comments_per_page');
2057 2057
 	}
2058 2058
 
2059
-	if ( empty($r['per_page']) ) {
2059
+	if (empty($r['per_page'])) {
2060 2060
 		$r['per_page'] = 0;
2061 2061
 		$r['page'] = 0;
2062 2062
 	}
2063 2063
 
2064
-	if ( '' === $r['max_depth'] ) {
2065
-		if ( get_option('thread_comments') )
2064
+	if ('' === $r['max_depth']) {
2065
+		if (get_option('thread_comments'))
2066 2066
 			$r['max_depth'] = get_option('thread_comments_depth');
2067 2067
 		else
2068 2068
 			$r['max_depth'] = -1;
2069 2069
 	}
2070 2070
 
2071
-	if ( '' === $r['page'] ) {
2072
-		if ( empty($overridden_cpage) ) {
2071
+	if ('' === $r['page']) {
2072
+		if (empty($overridden_cpage)) {
2073 2073
 			$r['page'] = get_query_var('cpage');
2074 2074
 		} else {
2075 2075
 			$threaded = ( -1 != $r['max_depth'] );
2076
-			$r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
2077
-			set_query_var( 'cpage', $r['page'] );
2076
+			$r['page'] = ('newest' == get_option('default_comments_page')) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
2077
+			set_query_var('cpage', $r['page']);
2078 2078
 		}
2079 2079
 	}
2080 2080
 	// Validation check
2081 2081
 	$r['page'] = intval($r['page']);
2082
-	if ( 0 == $r['page'] && 0 != $r['per_page'] )
2082
+	if (0 == $r['page'] && 0 != $r['per_page'])
2083 2083
 		$r['page'] = 1;
2084 2084
 
2085
-	if ( null === $r['reverse_top_level'] )
2086
-		$r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
2085
+	if (null === $r['reverse_top_level'])
2086
+		$r['reverse_top_level'] = ('desc' == get_option('comment_order'));
2087 2087
 
2088
-	wp_queue_comments_for_comment_meta_lazyload( $_comments );
2088
+	wp_queue_comments_for_comment_meta_lazyload($_comments);
2089 2089
 
2090
-	if ( empty( $r['walker'] ) ) {
2090
+	if (empty($r['walker'])) {
2091 2091
 		$walker = new Walker_Comment;
2092 2092
 	} else {
2093 2093
 		$walker = $r['walker'];
2094 2094
 	}
2095 2095
 
2096
-	$output = $walker->paged_walk( $_comments, $r['max_depth'], $r['page'], $r['per_page'], $r );
2096
+	$output = $walker->paged_walk($_comments, $r['max_depth'], $r['page'], $r['per_page'], $r);
2097 2097
 
2098 2098
 	$in_comment_loop = false;
2099 2099
 
2100
-	if ( $r['echo'] ) {
2100
+	if ($r['echo']) {
2101 2101
 		echo $output;
2102 2102
 	} else {
2103 2103
 		return $output;
@@ -2166,18 +2166,18 @@  discard block
 block discarded – undo
2166 2166
  * }
2167 2167
  * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.
2168 2168
  */
2169
-function comment_form( $args = array(), $post_id = null ) {
2170
-	if ( null === $post_id )
2169
+function comment_form($args = array(), $post_id = null) {
2170
+	if (null === $post_id)
2171 2171
 		$post_id = get_the_ID();
2172 2172
 
2173 2173
 	// Exit the function when comments for the post are closed.
2174
-	if ( ! comments_open( $post_id ) ) {
2174
+	if ( ! comments_open($post_id)) {
2175 2175
 		/**
2176 2176
 		 * Fires after the comment form if comments are closed.
2177 2177
 		 *
2178 2178
 		 * @since 3.0.0
2179 2179
 		 */
2180
-		do_action( 'comment_form_comments_closed' );
2180
+		do_action('comment_form_comments_closed');
2181 2181
 
2182 2182
 		return;
2183 2183
 	}
@@ -2186,24 +2186,24 @@  discard block
 block discarded – undo
2186 2186
 	$user = wp_get_current_user();
2187 2187
 	$user_identity = $user->exists() ? $user->display_name : '';
2188 2188
 
2189
-	$args = wp_parse_args( $args );
2190
-	if ( ! isset( $args['format'] ) )
2191
-		$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
2189
+	$args = wp_parse_args($args);
2190
+	if ( ! isset($args['format']))
2191
+		$args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml';
2192 2192
 
2193
-	$req      = get_option( 'require_name_email' );
2194
-	$aria_req = ( $req ? " aria-required='true'" : '' );
2195
-	$html_req = ( $req ? " required='required'" : '' );
2193
+	$req      = get_option('require_name_email');
2194
+	$aria_req = ($req ? " aria-required='true'" : '');
2195
+	$html_req = ($req ? " required='required'" : '');
2196 2196
 	$html5    = 'html5' === $args['format'];
2197
-	$fields   =  array(
2198
-		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
2199
-		            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
2200
-		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
2201
-		            '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
2202
-		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
2203
-		            '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
2197
+	$fields   = array(
2198
+		'author' => '<p class="comment-form-author">'.'<label for="author">'.__('Name').($req ? ' <span class="required">*</span>' : '').'</label> '.
2199
+		            '<input id="author" name="author" type="text" value="'.esc_attr($commenter['comment_author']).'" size="30" maxlength="245"'.$aria_req.$html_req.' /></p>',
2200
+		'email'  => '<p class="comment-form-email"><label for="email">'.__('Email').($req ? ' <span class="required">*</span>' : '').'</label> '.
2201
+		            '<input id="email" name="email" '.($html5 ? 'type="email"' : 'type="text"').' value="'.esc_attr($commenter['comment_author_email']).'" size="30" maxlength="100" aria-describedby="email-notes"'.$aria_req.$html_req.' /></p>',
2202
+		'url'    => '<p class="comment-form-url"><label for="url">'.__('Website').'</label> '.
2203
+		            '<input id="url" name="url" '.($html5 ? 'type="url"' : 'type="text"').' value="'.esc_attr($commenter['comment_author_url']).'" size="30" maxlength="200" /></p>',
2204 2204
 	);
2205 2205
 
2206
-	$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
2206
+	$required_text = sprintf(' '.__('Required fields are marked %s'), '<span class="required">*</span>');
2207 2207
 
2208 2208
 	/**
2209 2209
 	 * Filters the default comment form fields.
@@ -2212,42 +2212,42 @@  discard block
 block discarded – undo
2212 2212
 	 *
2213 2213
 	 * @param array $fields The default comment fields.
2214 2214
 	 */
2215
-	$fields = apply_filters( 'comment_form_default_fields', $fields );
2215
+	$fields = apply_filters('comment_form_default_fields', $fields);
2216 2216
 	$defaults = array(
2217 2217
 		'fields'               => $fields,
2218
-		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
2218
+		'comment_field'        => '<p class="comment-form-comment"><label for="comment">'._x('Comment', 'noun').'</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
2219 2219
 		/** This filter is documented in wp-includes/link-template.php */
2220
-		'must_log_in'          => '<p class="must-log-in">' . sprintf(
2220
+		'must_log_in'          => '<p class="must-log-in">'.sprintf(
2221 2221
 		                              /* translators: %s: login URL */
2222
-		                              __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
2223
-		                              wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2224
-		                          ) . '</p>',
2222
+		                              __('You must be <a href="%s">logged in</a> to post a comment.'),
2223
+		                              wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))
2224
+		                          ).'</p>',
2225 2225
 		/** This filter is documented in wp-includes/link-template.php */
2226
-		'logged_in_as'         => '<p class="logged-in-as">' . sprintf(
2226
+		'logged_in_as'         => '<p class="logged-in-as">'.sprintf(
2227 2227
 		                              /* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
2228
-		                              __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
2228
+		                              __('<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>'),
2229 2229
 		                              get_edit_user_link(),
2230 2230
 		                              /* translators: %s: user name */
2231
-		                              esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
2231
+		                              esc_attr(sprintf(__('Logged in as %s. Edit your profile.'), $user_identity)),
2232 2232
 		                              $user_identity,
2233
-		                              wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2234
-		                          ) . '</p>',
2235
-		'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
2233
+		                              wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))
2234
+		                          ).'</p>',
2235
+		'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">'.__('Your email address will not be published.').'</span>'.($req ? $required_text : '').'</p>',
2236 2236
 		'comment_notes_after'  => '',
2237
-		'action'               => site_url( '/wp-comments-post.php' ),
2237
+		'action'               => site_url('/wp-comments-post.php'),
2238 2238
 		'id_form'              => 'commentform',
2239 2239
 		'id_submit'            => 'submit',
2240 2240
 		'class_form'           => 'comment-form',
2241 2241
 		'class_submit'         => 'submit',
2242 2242
 		'name_submit'          => 'submit',
2243
-		'title_reply'          => __( 'Leave a Reply' ),
2244
-		'title_reply_to'       => __( 'Leave a Reply to %s' ),
2243
+		'title_reply'          => __('Leave a Reply'),
2244
+		'title_reply_to'       => __('Leave a Reply to %s'),
2245 2245
 		'title_reply_before'   => '<h3 id="reply-title" class="comment-reply-title">',
2246 2246
 		'title_reply_after'    => '</h3>',
2247 2247
 		'cancel_reply_before'  => ' <small>',
2248 2248
 		'cancel_reply_after'   => '</small>',
2249
-		'cancel_reply_link'    => __( 'Cancel reply' ),
2250
-		'label_submit'         => __( 'Post Comment' ),
2249
+		'cancel_reply_link'    => __('Cancel reply'),
2250
+		'label_submit'         => __('Post Comment'),
2251 2251
 		'submit_button'        => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',
2252 2252
 		'submit_field'         => '<p class="form-submit">%1$s %2$s</p>',
2253 2253
 		'format'               => 'xhtml',
@@ -2262,51 +2262,51 @@  discard block
 block discarded – undo
2262 2262
 	 *
2263 2263
 	 * @param array $defaults The default comment form arguments.
2264 2264
 	 */
2265
-	$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
2265
+	$args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults));
2266 2266
 
2267 2267
 	// Ensure that the filtered args contain all required default values.
2268
-	$args = array_merge( $defaults, $args );
2268
+	$args = array_merge($defaults, $args);
2269 2269
 
2270 2270
 	/**
2271 2271
 	 * Fires before the comment form.
2272 2272
 	 *
2273 2273
 	 * @since 3.0.0
2274 2274
 	 */
2275
-	do_action( 'comment_form_before' );
2275
+	do_action('comment_form_before');
2276 2276
 	?>
2277 2277
 	<div id="respond" class="comment-respond">
2278 2278
 		<?php
2279 2279
 		echo $args['title_reply_before'];
2280 2280
 
2281
-		comment_form_title( $args['title_reply'], $args['title_reply_to'] );
2281
+		comment_form_title($args['title_reply'], $args['title_reply_to']);
2282 2282
 
2283 2283
 		echo $args['cancel_reply_before'];
2284 2284
 
2285
-		cancel_comment_reply_link( $args['cancel_reply_link'] );
2285
+		cancel_comment_reply_link($args['cancel_reply_link']);
2286 2286
 
2287 2287
 		echo $args['cancel_reply_after'];
2288 2288
 
2289 2289
 		echo $args['title_reply_after'];
2290 2290
 
2291
-		if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) :
2291
+		if (get_option('comment_registration') && ! is_user_logged_in()) :
2292 2292
 			echo $args['must_log_in'];
2293 2293
 			/**
2294 2294
 			 * Fires after the HTML-formatted 'must log in after' message in the comment form.
2295 2295
 			 *
2296 2296
 			 * @since 3.0.0
2297 2297
 			 */
2298
-			do_action( 'comment_form_must_log_in_after' );
2298
+			do_action('comment_form_must_log_in_after');
2299 2299
 		else : ?>
2300
-			<form action="<?php echo esc_url( $args['action'] ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
2300
+			<form action="<?php echo esc_url($args['action']); ?>" method="post" id="<?php echo esc_attr($args['id_form']); ?>" class="<?php echo esc_attr($args['class_form']); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
2301 2301
 				<?php
2302 2302
 				/**
2303 2303
 				 * Fires at the top of the comment form, inside the form tag.
2304 2304
 				 *
2305 2305
 				 * @since 3.0.0
2306 2306
 				 */
2307
-				do_action( 'comment_form_top' );
2307
+				do_action('comment_form_top');
2308 2308
 
2309
-				if ( is_user_logged_in() ) :
2309
+				if (is_user_logged_in()) :
2310 2310
 					/**
2311 2311
 					 * Filters the 'logged in' message for the comment form for display.
2312 2312
 					 *
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
 					 * @param string $user_identity  If the commenter is a registered user,
2319 2319
 					 *                               the display name, blank otherwise.
2320 2320
 					 */
2321
-					echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );
2321
+					echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity);
2322 2322
 
2323 2323
 					/**
2324 2324
 					 * Fires after the is_user_logged_in() check in the comment form.
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
 					 * @param string $user_identity If the commenter is a registered user,
2331 2331
 					 *                              the display name, blank otherwise.
2332 2332
 					 */
2333
-					do_action( 'comment_form_logged_in_after', $commenter, $user_identity );
2333
+					do_action('comment_form_logged_in_after', $commenter, $user_identity);
2334 2334
 
2335 2335
 				else :
2336 2336
 
@@ -2339,7 +2339,7 @@  discard block
 block discarded – undo
2339 2339
 				endif;
2340 2340
 
2341 2341
 				// Prepare an array of all fields, including the textarea
2342
-				$comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields'];
2342
+				$comment_fields = array('comment' => $args['comment_field']) + (array) $args['fields'];
2343 2343
 
2344 2344
 				/**
2345 2345
 				 * Filters the comment form fields, including the textarea.
@@ -2348,18 +2348,18 @@  discard block
 block discarded – undo
2348 2348
 				 *
2349 2349
 				 * @param array $comment_fields The comment fields.
2350 2350
 				 */
2351
-				$comment_fields = apply_filters( 'comment_form_fields', $comment_fields );
2351
+				$comment_fields = apply_filters('comment_form_fields', $comment_fields);
2352 2352
 
2353 2353
 				// Get an array of field names, excluding the textarea
2354
-				$comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) );
2354
+				$comment_field_keys = array_diff(array_keys($comment_fields), array('comment'));
2355 2355
 
2356 2356
 				// Get the first and the last field name, excluding the textarea
2357
-				$first_field = reset( $comment_field_keys );
2358
-				$last_field  = end( $comment_field_keys );
2357
+				$first_field = reset($comment_field_keys);
2358
+				$last_field  = end($comment_field_keys);
2359 2359
 
2360
-				foreach ( $comment_fields as $name => $field ) {
2360
+				foreach ($comment_fields as $name => $field) {
2361 2361
 
2362
-					if ( 'comment' === $name ) {
2362
+					if ('comment' === $name) {
2363 2363
 
2364 2364
 						/**
2365 2365
 						 * Filters the content of the comment textarea field for display.
@@ -2368,19 +2368,19 @@  discard block
 block discarded – undo
2368 2368
 						 *
2369 2369
 						 * @param string $args_comment_field The content of the comment textarea field.
2370 2370
 						 */
2371
-						echo apply_filters( 'comment_form_field_comment', $field );
2371
+						echo apply_filters('comment_form_field_comment', $field);
2372 2372
 
2373 2373
 						echo $args['comment_notes_after'];
2374 2374
 
2375
-					} elseif ( ! is_user_logged_in() ) {
2375
+					} elseif ( ! is_user_logged_in()) {
2376 2376
 
2377
-						if ( $first_field === $name ) {
2377
+						if ($first_field === $name) {
2378 2378
 							/**
2379 2379
 							 * Fires before the comment fields in the comment form, excluding the textarea.
2380 2380
 							 *
2381 2381
 							 * @since 3.0.0
2382 2382
 							 */
2383
-							do_action( 'comment_form_before_fields' );
2383
+							do_action('comment_form_before_fields');
2384 2384
 						}
2385 2385
 
2386 2386
 						/**
@@ -2393,25 +2393,25 @@  discard block
 block discarded – undo
2393 2393
 						 *
2394 2394
 						 * @param string $field The HTML-formatted output of the comment form field.
2395 2395
 						 */
2396
-						echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
2396
+						echo apply_filters("comment_form_field_{$name}", $field)."\n";
2397 2397
 
2398
-						if ( $last_field === $name ) {
2398
+						if ($last_field === $name) {
2399 2399
 							/**
2400 2400
 							 * Fires after the comment fields in the comment form, excluding the textarea.
2401 2401
 							 *
2402 2402
 							 * @since 3.0.0
2403 2403
 							 */
2404
-							do_action( 'comment_form_after_fields' );
2404
+							do_action('comment_form_after_fields');
2405 2405
 						}
2406 2406
 					}
2407 2407
 				}
2408 2408
 
2409 2409
 				$submit_button = sprintf(
2410 2410
 					$args['submit_button'],
2411
-					esc_attr( $args['name_submit'] ),
2412
-					esc_attr( $args['id_submit'] ),
2413
-					esc_attr( $args['class_submit'] ),
2414
-					esc_attr( $args['label_submit'] )
2411
+					esc_attr($args['name_submit']),
2412
+					esc_attr($args['id_submit']),
2413
+					esc_attr($args['class_submit']),
2414
+					esc_attr($args['label_submit'])
2415 2415
 				);
2416 2416
 
2417 2417
 				/**
@@ -2422,12 +2422,12 @@  discard block
 block discarded – undo
2422 2422
 				 * @param string $submit_button HTML markup for the submit button.
2423 2423
 				 * @param array  $args          Arguments passed to `comment_form()`.
2424 2424
 				 */
2425
-				$submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args );
2425
+				$submit_button = apply_filters('comment_form_submit_button', $submit_button, $args);
2426 2426
 
2427 2427
 				$submit_field = sprintf(
2428 2428
 					$args['submit_field'],
2429 2429
 					$submit_button,
2430
-					get_comment_id_fields( $post_id )
2430
+					get_comment_id_fields($post_id)
2431 2431
 				);
2432 2432
 
2433 2433
 				/**
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
 				 * @param string $submit_field HTML markup for the submit field.
2442 2442
 				 * @param array  $args         Arguments passed to comment_form().
2443 2443
 				 */
2444
-				echo apply_filters( 'comment_form_submit_field', $submit_field, $args );
2444
+				echo apply_filters('comment_form_submit_field', $submit_field, $args);
2445 2445
 
2446 2446
 				/**
2447 2447
 				 * Fires at the bottom of the comment form, inside the closing </form> tag.
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
 				 *
2451 2451
 				 * @param int $post_id The post ID.
2452 2452
 				 */
2453
-				do_action( 'comment_form', $post_id );
2453
+				do_action('comment_form', $post_id);
2454 2454
 				?>
2455 2455
 			</form>
2456 2456
 		<?php endif; ?>
@@ -2462,5 +2462,5 @@  discard block
 block discarded – undo
2462 2462
 	 *
2463 2463
 	 * @since 3.0.0
2464 2464
 	 */
2465
-	do_action( 'comment_form_after' );
2465
+	do_action('comment_form_after');
2466 2466
 }
Please login to merge, or discard this patch.
src/wp-includes/link-template.php 3 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @since 1.2.0
13 13
  * @since 4.4.0 Added the `$post` parameter.
14 14
  *
15
- * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
15
+ * @param integer $post Optional. Post ID or post object. Default is the global `$post`.
16 16
  */
17 17
 function the_permalink( $post = 0 ) {
18 18
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  *
98 98
  * @see get_permalink()
99 99
  *
100
- * @param int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
100
+ * @param integer $post      Optional. Post ID or post object. Default is the global `$post`.
101 101
  * @param bool        $leavename Optional. Whether to keep post name or page name. Default false.
102 102
  *
103 103
  * @return string|false The permalink URL or false if post does not exist.
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
  *
112 112
  * @since 1.0.0
113 113
  *
114
- * @param int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
114
+ * @param integer $post      Optional. Post ID or post object. Default is the global `$post`.
115 115
  * @param bool        $leavename Optional. Whether to keep post name or page name. Default false.
116 116
  * @return string|false The permalink URL or false if post does not exist.
117 117
  */
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
  *
1388 1388
  * @since 2.3.0
1389 1389
  *
1390
- * @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.
1390
+ * @param integer $comment_id Optional. Comment ID or WP_Comment object.
1391 1391
  * @return string|void The edit comment link URL for the given comment.
1392 1392
  */
1393 1393
 function get_edit_comment_link( $comment_id = 0 ) {
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
  *
1448 1448
  * @since 2.7.0
1449 1449
  *
1450
- * @param int|stdClass $link Optional. Bookmark ID. Default is the id of the current bookmark.
1450
+ * @param integer $link Optional. Bookmark ID. Default is the id of the current bookmark.
1451 1451
  * @return string|void The edit bookmark link URL.
1452 1452
  */
1453 1453
 function get_edit_bookmark_link( $link = 0 ) {
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
  * @since 1.5.0
1546 1546
  *
1547 1547
  * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
1548
- * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1548
+ * @param string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1549 1549
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1550 1550
  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
1551 1551
  *                             corresponding post exists.
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
  * @since 1.5.0
1561 1561
  *
1562 1562
  * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.
1563
- * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1563
+ * @param string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1564 1564
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1565 1565
  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
1566 1566
  *                             corresponding post exists.
@@ -1873,7 +1873,7 @@  discard block
 block discarded – undo
1873 1873
  *
1874 1874
  * @param bool         $in_same_term   Optional. Whether returned post should be in a same taxonomy term.
1875 1875
  *                                     Default false.
1876
- * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
1876
+ * @param string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
1877 1877
  *                                     Default empty.
1878 1878
  * @param bool         $start          Optional. Whether to retrieve first or last post. Default true
1879 1879
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
@@ -2761,7 +2761,7 @@  discard block
 block discarded – undo
2761 2761
  * @global WP_Rewrite $wp_rewrite
2762 2762
  *
2763 2763
  * @param string|array $args Optional args. See paginate_links(). Default empty array.
2764
- * @return string|void Markup for pagination links.
2764
+ * @return string Markup for pagination links.
2765 2765
  */
2766 2766
 function paginate_comments_links( $args = array() ) {
2767 2767
 	global $wp_rewrite;
Please login to merge, or discard this patch.
Spacing   +826 added lines, -826 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  *
15 15
  * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
16 16
  */
17
-function the_permalink( $post = 0 ) {
17
+function the_permalink($post = 0) {
18 18
 	/**
19 19
 	 * Filters the display of the permalink for the current post.
20 20
 	 *
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @param string      $permalink The permalink for the current post.
25 25
 	 * @param int|WP_Post $post      Post ID, WP_Post object, or 0. Default 0.
26 26
 	 */
27
-	echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) );
27
+	echo esc_url(apply_filters('the_permalink', get_permalink($post), $post));
28 28
 }
29 29
 
30 30
 /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function user_trailingslashit($string, $type_of_url = '') {
48 48
 	global $wp_rewrite;
49
-	if ( $wp_rewrite->use_trailing_slashes )
49
+	if ($wp_rewrite->use_trailing_slashes)
50 50
 		$string = trailingslashit($string);
51 51
 	else
52 52
 		$string = untrailingslashit($string);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 *                            'single_feed', 'single_paged', 'commentpaged', 'paged', 'home', 'feed',
62 62
 	 *                            'category', 'page', 'year', 'month', 'day', 'post_type_archive'.
63 63
 	 */
64
-	return apply_filters( 'user_trailingslashit', $string, $type_of_url );
64
+	return apply_filters('user_trailingslashit', $string, $type_of_url);
65 65
 }
66 66
 
67 67
 /**
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
  *
75 75
  * @param string $mode Optional. Permalink mode. Accepts 'title' or 'id'. Default 'id'.
76 76
  */
77
-function permalink_anchor( $mode = 'id' ) {
77
+function permalink_anchor($mode = 'id') {
78 78
 	$post = get_post();
79
-	switch ( strtolower( $mode ) ) {
79
+	switch (strtolower($mode)) {
80 80
 		case 'title':
81
-			$title = sanitize_title( $post->post_title ) . '-' . $post->ID;
81
+			$title = sanitize_title($post->post_title).'-'.$post->ID;
82 82
 			echo '<a id="'.$title.'"></a>';
83 83
 			break;
84 84
 		case 'id':
85 85
 		default:
86
-			echo '<a id="post-' . $post->ID . '"></a>';
86
+			echo '<a id="post-'.$post->ID.'"></a>';
87 87
 			break;
88 88
 	}
89 89
 }
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
  *
103 103
  * @return string|false The permalink URL or false if post does not exist.
104 104
  */
105
-function get_the_permalink( $post = 0, $leavename = false ) {
106
-	return get_permalink( $post, $leavename );
105
+function get_the_permalink($post = 0, $leavename = false) {
106
+	return get_permalink($post, $leavename);
107 107
 }
108 108
 
109 109
 /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
  * @param bool        $leavename Optional. Whether to keep post name or page name. Default false.
116 116
  * @return string|false The permalink URL or false if post does not exist.
117 117
  */
118
-function get_permalink( $post = 0, $leavename = false ) {
118
+function get_permalink($post = 0, $leavename = false) {
119 119
 	$rewritecode = array(
120 120
 		'%year%',
121 121
 		'%monthnum%',
@@ -123,28 +123,28 @@  discard block
 block discarded – undo
123 123
 		'%hour%',
124 124
 		'%minute%',
125 125
 		'%second%',
126
-		$leavename? '' : '%postname%',
126
+		$leavename ? '' : '%postname%',
127 127
 		'%post_id%',
128 128
 		'%category%',
129 129
 		'%author%',
130
-		$leavename? '' : '%pagename%',
130
+		$leavename ? '' : '%pagename%',
131 131
 	);
132 132
 
133
-	if ( is_object( $post ) && isset( $post->filter ) && 'sample' == $post->filter ) {
133
+	if (is_object($post) && isset($post->filter) && 'sample' == $post->filter) {
134 134
 		$sample = true;
135 135
 	} else {
136
-		$post = get_post( $post );
136
+		$post = get_post($post);
137 137
 		$sample = false;
138 138
 	}
139 139
 
140
-	if ( empty($post->ID) )
140
+	if (empty($post->ID))
141 141
 		return false;
142 142
 
143
-	if ( $post->post_type == 'page' )
143
+	if ($post->post_type == 'page')
144 144
 		return get_page_link($post, $leavename, $sample);
145
-	elseif ( $post->post_type == 'attachment' )
146
-		return get_attachment_link( $post, $leavename );
147
-	elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) )
145
+	elseif ($post->post_type == 'attachment')
146
+		return get_attachment_link($post, $leavename);
147
+	elseif (in_array($post->post_type, get_post_types(array('_builtin' => false))))
148 148
 		return get_post_permalink($post, $leavename, $sample);
149 149
 
150 150
 	$permalink = get_option('permalink_structure');
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
 	 * @param WP_Post $post      The post in question.
161 161
 	 * @param bool    $leavename Whether to keep the post name.
162 162
 	 */
163
-	$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
163
+	$permalink = apply_filters('pre_post_link', $permalink, $post, $leavename);
164 164
 
165
-	if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
165
+	if ('' != $permalink && ! in_array($post->post_status, array('draft', 'pending', 'auto-draft', 'future'))) {
166 166
 		$unixtime = strtotime($post->post_date);
167 167
 
168 168
 		$category = '';
169
-		if ( strpos($permalink, '%category%') !== false ) {
169
+		if (strpos($permalink, '%category%') !== false) {
170 170
 			$cats = get_the_category($post->ID);
171
-			if ( $cats ) {
172
-				$cats = wp_list_sort( $cats, array(
171
+			if ($cats) {
172
+				$cats = wp_list_sort($cats, array(
173 173
 					'term_id' => 'ASC',
174
-				) );
174
+				));
175 175
 
176 176
 				/**
177 177
 				 * Filters the category that gets used in the %category% permalink token.
@@ -182,30 +182,30 @@  discard block
 block discarded – undo
182 182
 				 * @param array    $cats Array of all categories (WP_Term objects) associated with the post.
183 183
 				 * @param WP_Post  $post The post in question.
184 184
 				 */
185
-				$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );
185
+				$category_object = apply_filters('post_link_category', $cats[0], $cats, $post);
186 186
 
187
-				$category_object = get_term( $category_object, 'category' );
187
+				$category_object = get_term($category_object, 'category');
188 188
 				$category = $category_object->slug;
189
-				if ( $parent = $category_object->parent )
190
-					$category = get_category_parents($parent, false, '/', true) . $category;
189
+				if ($parent = $category_object->parent)
190
+					$category = get_category_parents($parent, false, '/', true).$category;
191 191
 			}
192 192
 			// show default category in permalinks, without
193 193
 			// having to assign it explicitly
194
-			if ( empty($category) ) {
195
-				$default_category = get_term( get_option( 'default_category' ), 'category' );
196
-				if ( $default_category && ! is_wp_error( $default_category ) ) {
194
+			if (empty($category)) {
195
+				$default_category = get_term(get_option('default_category'), 'category');
196
+				if ($default_category && ! is_wp_error($default_category)) {
197 197
 					$category = $default_category->slug;
198 198
 				}
199 199
 			}
200 200
 		}
201 201
 
202 202
 		$author = '';
203
-		if ( strpos($permalink, '%author%') !== false ) {
203
+		if (strpos($permalink, '%author%') !== false) {
204 204
 			$authordata = get_userdata($post->post_author);
205 205
 			$author = $authordata->user_nicename;
206 206
 		}
207 207
 
208
-		$date = explode(" ",date('Y m d H i s', $unixtime));
208
+		$date = explode(" ", date('Y m d H i s', $unixtime));
209 209
 		$rewritereplace =
210 210
 		array(
211 211
 			$date[0],
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 			$author,
221 221
 			$post->post_name,
222 222
 		);
223
-		$permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) );
223
+		$permalink = home_url(str_replace($rewritecode, $rewritereplace, $permalink));
224 224
 		$permalink = user_trailingslashit($permalink, 'single');
225 225
 	} else { // if they're not using the fancy permalink option
226
-		$permalink = home_url('?p=' . $post->ID);
226
+		$permalink = home_url('?p='.$post->ID);
227 227
 	}
228 228
 
229 229
 	/**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @param WP_Post $post      The post in question.
238 238
 	 * @param bool    $leavename Whether to keep the post name.
239 239
 	 */
240
-	return apply_filters( 'post_link', $permalink, $post, $leavename );
240
+	return apply_filters('post_link', $permalink, $post, $leavename);
241 241
 }
242 242
 
243 243
 /**
@@ -252,33 +252,33 @@  discard block
 block discarded – undo
252 252
  * @param bool $sample    Optional, defaults to false. Is it a sample permalink. Default false.
253 253
  * @return string|WP_Error The post permalink.
254 254
  */
255
-function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
255
+function get_post_permalink($id = 0, $leavename = false, $sample = false) {
256 256
 	global $wp_rewrite;
257 257
 
258 258
 	$post = get_post($id);
259 259
 
260
-	if ( is_wp_error( $post ) )
260
+	if (is_wp_error($post))
261 261
 		return $post;
262 262
 
263 263
 	$post_link = $wp_rewrite->get_extra_permastruct($post->post_type);
264 264
 
265 265
 	$slug = $post->post_name;
266 266
 
267
-	$draft_or_pending = get_post_status( $id ) && in_array( get_post_status( $id ), array( 'draft', 'pending', 'auto-draft', 'future' ) );
267
+	$draft_or_pending = get_post_status($id) && in_array(get_post_status($id), array('draft', 'pending', 'auto-draft', 'future'));
268 268
 
269 269
 	$post_type = get_post_type_object($post->post_type);
270 270
 
271
-	if ( $post_type->hierarchical ) {
272
-		$slug = get_page_uri( $id );
271
+	if ($post_type->hierarchical) {
272
+		$slug = get_page_uri($id);
273 273
 	}
274 274
 
275
-	if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
276
-		if ( ! $leavename ) {
275
+	if ( ! empty($post_link) && ( ! $draft_or_pending || $sample)) {
276
+		if ( ! $leavename) {
277 277
 			$post_link = str_replace("%$post->post_type%", $slug, $post_link);
278 278
 		}
279
-		$post_link = home_url( user_trailingslashit($post_link) );
279
+		$post_link = home_url(user_trailingslashit($post_link));
280 280
 	} else {
281
-		if ( $post_type->query_var && ( isset($post->post_status) && !$draft_or_pending ) )
281
+		if ($post_type->query_var && (isset($post->post_status) && ! $draft_or_pending))
282 282
 			$post_link = add_query_arg($post_type->query_var, $slug, '');
283 283
 		else
284 284
 			$post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 * @param bool    $leavename Whether to keep the post name.
296 296
 	 * @param bool    $sample    Is it a sample permalink.
297 297
 	 */
298
-	return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );
298
+	return apply_filters('post_type_link', $post_link, $post, $leavename, $sample);
299 299
 }
300 300
 
301 301
 /**
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
  *                               Default false.
312 312
  * @return string The page permalink.
313 313
  */
314
-function get_page_link( $post = false, $leavename = false, $sample = false ) {
315
-	$post = get_post( $post );
314
+function get_page_link($post = false, $leavename = false, $sample = false) {
315
+	$post = get_post($post);
316 316
 
317
-	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) )
317
+	if ('page' == get_option('show_on_front') && $post->ID == get_option('page_on_front'))
318 318
 		$link = home_url('/');
319 319
 	else
320
-		$link = _get_page_link( $post, $leavename, $sample );
320
+		$link = _get_page_link($post, $leavename, $sample);
321 321
 
322 322
 	/**
323 323
 	 * Filters the permalink for a page.
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 * @param int    $post_id The ID of the page.
329 329
 	 * @param bool   $sample  Is it a sample permalink.
330 330
 	 */
331
-	return apply_filters( 'page_link', $link, $post->ID, $sample );
331
+	return apply_filters('page_link', $link, $post->ID, $sample);
332 332
 }
333 333
 
334 334
 /**
@@ -347,24 +347,24 @@  discard block
 block discarded – undo
347 347
  *                               Default false.
348 348
  * @return string The page permalink.
349 349
  */
350
-function _get_page_link( $post = false, $leavename = false, $sample = false ) {
350
+function _get_page_link($post = false, $leavename = false, $sample = false) {
351 351
 	global $wp_rewrite;
352 352
 
353
-	$post = get_post( $post );
353
+	$post = get_post($post);
354 354
 
355
-	$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
355
+	$draft_or_pending = in_array($post->post_status, array('draft', 'pending', 'auto-draft'));
356 356
 
357 357
 	$link = $wp_rewrite->get_page_permastruct();
358 358
 
359
-	if ( !empty($link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
360
-		if ( ! $leavename ) {
361
-			$link = str_replace('%pagename%', get_page_uri( $post ), $link);
359
+	if ( ! empty($link) && ((isset($post->post_status) && ! $draft_or_pending) || $sample)) {
360
+		if ( ! $leavename) {
361
+			$link = str_replace('%pagename%', get_page_uri($post), $link);
362 362
 		}
363 363
 
364 364
 		$link = home_url($link);
365 365
 		$link = user_trailingslashit($link, 'page');
366 366
 	} else {
367
-		$link = home_url( '?page_id=' . $post->ID );
367
+		$link = home_url('?page_id='.$post->ID);
368 368
 	}
369 369
 
370 370
 	/**
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	 * @param string $link    The page's permalink.
376 376
 	 * @param int    $post_id The ID of the page.
377 377
 	 */
378
-	return apply_filters( '_get_page_link', $link, $post->ID );
378
+	return apply_filters('_get_page_link', $link, $post->ID);
379 379
 }
380 380
 
381 381
 /**
@@ -391,39 +391,39 @@  discard block
 block discarded – undo
391 391
  * @param bool       $leavename Optional. Whether to keep the page name. Default false.
392 392
  * @return string The attachment permalink.
393 393
  */
394
-function get_attachment_link( $post = null, $leavename = false ) {
394
+function get_attachment_link($post = null, $leavename = false) {
395 395
 	global $wp_rewrite;
396 396
 
397 397
 	$link = false;
398 398
 
399
-	$post = get_post( $post );
400
-	$parent = ( $post->post_parent > 0 && $post->post_parent != $post->ID ) ? get_post( $post->post_parent ) : false;
401
-	if ( $parent && ! in_array( $parent->post_type, get_post_types() ) ) {
399
+	$post = get_post($post);
400
+	$parent = ($post->post_parent > 0 && $post->post_parent != $post->ID) ? get_post($post->post_parent) : false;
401
+	if ($parent && ! in_array($parent->post_type, get_post_types())) {
402 402
 		$parent = false;
403 403
 	}
404 404
 
405
-	if ( $wp_rewrite->using_permalinks() && $parent ) {
406
-		if ( 'page' == $parent->post_type )
407
-			$parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front
405
+	if ($wp_rewrite->using_permalinks() && $parent) {
406
+		if ('page' == $parent->post_type)
407
+			$parentlink = _get_page_link($post->post_parent); // Ignores page_on_front
408 408
 		else
409
-			$parentlink = get_permalink( $post->post_parent );
409
+			$parentlink = get_permalink($post->post_parent);
410 410
 
411
-		if ( is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') )
412
-			$name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
411
+		if (is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%'))
412
+			$name = 'attachment/'.$post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
413 413
 		else
414 414
 			$name = $post->post_name;
415 415
 
416
-		if ( strpos($parentlink, '?') === false )
417
-			$link = user_trailingslashit( trailingslashit($parentlink) . '%postname%' );
416
+		if (strpos($parentlink, '?') === false)
417
+			$link = user_trailingslashit(trailingslashit($parentlink).'%postname%');
418 418
 
419
-		if ( ! $leavename )
420
-			$link = str_replace( '%postname%', $name, $link );
421
-	} elseif ( $wp_rewrite->using_permalinks() && ! $leavename ) {
422
-		$link = home_url( user_trailingslashit( $post->post_name ) );
419
+		if ( ! $leavename)
420
+			$link = str_replace('%postname%', $name, $link);
421
+	} elseif ($wp_rewrite->using_permalinks() && ! $leavename) {
422
+		$link = home_url(user_trailingslashit($post->post_name));
423 423
 	}
424 424
 
425
-	if ( ! $link )
426
-		$link = home_url( '/?attachment_id=' . $post->ID );
425
+	if ( ! $link)
426
+		$link = home_url('/?attachment_id='.$post->ID);
427 427
 
428 428
 	/**
429 429
 	 * Filters the permalink for an attachment.
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 	 * @param string $link    The attachment's permalink.
434 434
 	 * @param int    $post_id Attachment ID.
435 435
 	 */
436
-	return apply_filters( 'attachment_link', $link, $post->ID );
436
+	return apply_filters('attachment_link', $link, $post->ID);
437 437
 }
438 438
 
439 439
 /**
@@ -446,16 +446,16 @@  discard block
 block discarded – undo
446 446
  * @param int|bool $year False for current year or year for permalink.
447 447
  * @return string The permalink for the specified year archive.
448 448
  */
449
-function get_year_link( $year ) {
449
+function get_year_link($year) {
450 450
 	global $wp_rewrite;
451
-	if ( !$year )
451
+	if ( ! $year)
452 452
 		$year = gmdate('Y', current_time('timestamp'));
453 453
 	$yearlink = $wp_rewrite->get_year_permastruct();
454
-	if ( !empty($yearlink) ) {
454
+	if ( ! empty($yearlink)) {
455 455
 		$yearlink = str_replace('%year%', $year, $yearlink);
456
-		$yearlink = home_url( user_trailingslashit( $yearlink, 'year' ) );
456
+		$yearlink = home_url(user_trailingslashit($yearlink, 'year'));
457 457
 	} else {
458
-		$yearlink = home_url( '?m=' . $year );
458
+		$yearlink = home_url('?m='.$year);
459 459
 	}
460 460
 
461 461
 	/**
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 	 * @param string $yearlink Permalink for the year archive.
467 467
 	 * @param int    $year     Year for the archive.
468 468
 	 */
469
-	return apply_filters( 'year_link', $yearlink, $year );
469
+	return apply_filters('year_link', $yearlink, $year);
470 470
 }
471 471
 
472 472
 /**
@@ -482,17 +482,17 @@  discard block
 block discarded – undo
482 482
  */
483 483
 function get_month_link($year, $month) {
484 484
 	global $wp_rewrite;
485
-	if ( !$year )
485
+	if ( ! $year)
486 486
 		$year = gmdate('Y', current_time('timestamp'));
487
-	if ( !$month )
487
+	if ( ! $month)
488 488
 		$month = gmdate('m', current_time('timestamp'));
489 489
 	$monthlink = $wp_rewrite->get_month_permastruct();
490
-	if ( !empty($monthlink) ) {
490
+	if ( ! empty($monthlink)) {
491 491
 		$monthlink = str_replace('%year%', $year, $monthlink);
492 492
 		$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
493
-		$monthlink = home_url( user_trailingslashit( $monthlink, 'month' ) );
493
+		$monthlink = home_url(user_trailingslashit($monthlink, 'month'));
494 494
 	} else {
495
-		$monthlink = home_url( '?m=' . $year . zeroise( $month, 2 ) );
495
+		$monthlink = home_url('?m='.$year.zeroise($month, 2));
496 496
 	}
497 497
 
498 498
 	/**
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 	 * @param int    $year      Year for the archive.
505 505
 	 * @param int    $month     The month for the archive.
506 506
 	 */
507
-	return apply_filters( 'month_link', $monthlink, $year, $month );
507
+	return apply_filters('month_link', $monthlink, $year, $month);
508 508
 }
509 509
 
510 510
 /**
@@ -521,21 +521,21 @@  discard block
 block discarded – undo
521 521
  */
522 522
 function get_day_link($year, $month, $day) {
523 523
 	global $wp_rewrite;
524
-	if ( !$year )
524
+	if ( ! $year)
525 525
 		$year = gmdate('Y', current_time('timestamp'));
526
-	if ( !$month )
526
+	if ( ! $month)
527 527
 		$month = gmdate('m', current_time('timestamp'));
528
-	if ( !$day )
528
+	if ( ! $day)
529 529
 		$day = gmdate('j', current_time('timestamp'));
530 530
 
531 531
 	$daylink = $wp_rewrite->get_day_permastruct();
532
-	if ( !empty($daylink) ) {
532
+	if ( ! empty($daylink)) {
533 533
 		$daylink = str_replace('%year%', $year, $daylink);
534 534
 		$daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
535 535
 		$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
536
-		$daylink = home_url( user_trailingslashit( $daylink, 'day' ) );
536
+		$daylink = home_url(user_trailingslashit($daylink, 'day'));
537 537
 	} else {
538
-		$daylink = home_url( '?m=' . $year . zeroise( $month, 2 ) . zeroise( $day, 2 ) );
538
+		$daylink = home_url('?m='.$year.zeroise($month, 2).zeroise($day, 2));
539 539
 	}
540 540
 
541 541
 	/**
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	 * @param int    $month   Month for the archive.
549 549
 	 * @param int    $day     The day for the archive.
550 550
 	 */
551
-	return apply_filters( 'day_link', $daylink, $year, $month, $day );
551
+	return apply_filters('day_link', $daylink, $year, $month, $day);
552 552
 }
553 553
 
554 554
 /**
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
  * @param string $anchor The link's anchor text.
560 560
  * @param string $feed   Optional. Feed type. Default empty.
561 561
  */
562
-function the_feed_link( $anchor, $feed = '' ) {
563
-	$link = '<a href="' . esc_url( get_feed_link( $feed ) ) . '">' . $anchor . '</a>';
562
+function the_feed_link($anchor, $feed = '') {
563
+	$link = '<a href="'.esc_url(get_feed_link($feed)).'">'.$anchor.'</a>';
564 564
 
565 565
 	/**
566 566
 	 * Filters the feed link anchor tag.
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	 * @param string $feed The feed type, or an empty string for the
572 572
 	 *                     default feed type.
573 573
 	 */
574
-	echo apply_filters( 'the_feed_link', $link, $feed );
574
+	echo apply_filters('the_feed_link', $link, $feed);
575 575
 }
576 576
 
577 577
 /**
@@ -584,27 +584,27 @@  discard block
 block discarded – undo
584 584
  * @param string $feed Optional. Feed type. Default empty.
585 585
  * @return string The feed permalink.
586 586
  */
587
-function get_feed_link( $feed = '' ) {
587
+function get_feed_link($feed = '') {
588 588
 	global $wp_rewrite;
589 589
 
590 590
 	$permalink = $wp_rewrite->get_feed_permastruct();
591
-	if ( '' != $permalink ) {
592
-		if ( false !== strpos($feed, 'comments_') ) {
591
+	if ('' != $permalink) {
592
+		if (false !== strpos($feed, 'comments_')) {
593 593
 			$feed = str_replace('comments_', '', $feed);
594 594
 			$permalink = $wp_rewrite->get_comment_feed_permastruct();
595 595
 		}
596 596
 
597
-		if ( get_default_feed() == $feed )
597
+		if (get_default_feed() == $feed)
598 598
 			$feed = '';
599 599
 
600 600
 		$permalink = str_replace('%feed%', $feed, $permalink);
601 601
 		$permalink = preg_replace('#/+#', '/', "/$permalink");
602
-		$output =  home_url( user_trailingslashit($permalink, 'feed') );
602
+		$output = home_url(user_trailingslashit($permalink, 'feed'));
603 603
 	} else {
604
-		if ( empty($feed) )
604
+		if (empty($feed))
605 605
 			$feed = get_default_feed();
606 606
 
607
-		if ( false !== strpos($feed, 'comments_') )
607
+		if (false !== strpos($feed, 'comments_'))
608 608
 			$feed = str_replace('comments_', 'comments-', $feed);
609 609
 
610 610
 		$output = home_url("?feed={$feed}");
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 	 * @param string $output The feed permalink.
619 619
 	 * @param string $feed   Feed type.
620 620
 	 */
621
-	return apply_filters( 'feed_link', $output, $feed );
621
+	return apply_filters('feed_link', $output, $feed);
622 622
 }
623 623
 
624 624
 /**
@@ -630,43 +630,43 @@  discard block
 block discarded – undo
630 630
  * @param string $feed    Optional. Feed type. Default empty.
631 631
  * @return string The permalink for the comments feed for the given post.
632 632
  */
633
-function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
634
-	$post_id = absint( $post_id );
633
+function get_post_comments_feed_link($post_id = 0, $feed = '') {
634
+	$post_id = absint($post_id);
635 635
 
636
-	if ( ! $post_id )
636
+	if ( ! $post_id)
637 637
 		$post_id = get_the_ID();
638 638
 
639
-	if ( empty( $feed ) )
639
+	if (empty($feed))
640 640
 		$feed = get_default_feed();
641 641
 
642
-	$post = get_post( $post_id );
642
+	$post = get_post($post_id);
643 643
 	$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
644 644
 
645
-	if ( '' != get_option('permalink_structure') ) {
646
-		if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') )
647
-			$url = _get_page_link( $post_id );
645
+	if ('' != get_option('permalink_structure')) {
646
+		if ('page' == get_option('show_on_front') && $post_id == get_option('page_on_front'))
647
+			$url = _get_page_link($post_id);
648 648
 		else
649 649
 			$url = get_permalink($post_id);
650 650
 
651
-		if ( $unattached ) {
652
-			$url =  home_url( '/feed/' );
653
-			if ( $feed !== get_default_feed() ) {
651
+		if ($unattached) {
652
+			$url = home_url('/feed/');
653
+			if ($feed !== get_default_feed()) {
654 654
 				$url .= "$feed/";
655 655
 			}
656
-			$url = add_query_arg( 'attachment_id', $post_id, $url );
656
+			$url = add_query_arg('attachment_id', $post_id, $url);
657 657
 		} else {
658
-			$url = trailingslashit($url) . 'feed';
659
-			if ( $feed != get_default_feed() )
658
+			$url = trailingslashit($url).'feed';
659
+			if ($feed != get_default_feed())
660 660
 				$url .= "/$feed";
661 661
 			$url = user_trailingslashit($url, 'single_feed');
662 662
 		}
663 663
 	} else {
664
-		if ( $unattached ) {
665
-			$url = add_query_arg( array( 'feed' => $feed, 'attachment_id' => $post_id ), home_url( '/' ) );
666
-		} elseif ( 'page' == $post->post_type ) {
667
-			$url = add_query_arg( array( 'feed' => $feed, 'page_id' => $post_id ), home_url( '/' ) );
664
+		if ($unattached) {
665
+			$url = add_query_arg(array('feed' => $feed, 'attachment_id' => $post_id), home_url('/'));
666
+		} elseif ('page' == $post->post_type) {
667
+			$url = add_query_arg(array('feed' => $feed, 'page_id' => $post_id), home_url('/'));
668 668
 		} else {
669
-			$url = add_query_arg( array( 'feed' => $feed, 'p' => $post_id ), home_url( '/' ) );
669
+			$url = add_query_arg(array('feed' => $feed, 'p' => $post_id), home_url('/'));
670 670
 		}
671 671
 	}
672 672
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 *
678 678
 	 * @param string $url Post comments feed permalink.
679 679
 	 */
680
-	return apply_filters( 'post_comments_feed_link', $url );
680
+	return apply_filters('post_comments_feed_link', $url);
681 681
 }
682 682
 
683 683
 /**
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
  * @param int    $post_id   Optional. Post ID. Default is the ID of the global `$post`.
694 694
  * @param string $feed      Optional. Feed format. Default empty.
695 695
  */
696
-function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {
697
-	$url = get_post_comments_feed_link( $post_id, $feed );
698
-	if ( empty( $link_text ) ) {
696
+function post_comments_feed_link($link_text = '', $post_id = '', $feed = '') {
697
+	$url = get_post_comments_feed_link($post_id, $feed);
698
+	if (empty($link_text)) {
699 699
 		$link_text = __('Comments Feed');
700 700
 	}
701 701
 
702
-	$link = '<a href="' . esc_url( $url ) . '">' . $link_text . '</a>';
702
+	$link = '<a href="'.esc_url($url).'">'.$link_text.'</a>';
703 703
 	/**
704 704
 	 * Filters the post comment feed link anchor tag.
705 705
 	 *
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	 * @param int    $post_id Post ID.
710 710
 	 * @param string $feed    The feed type, or an empty string for the default feed type.
711 711
 	 */
712
-	echo apply_filters( 'post_comments_feed_link_html', $link, $post_id, $feed );
712
+	echo apply_filters('post_comments_feed_link_html', $link, $post_id, $feed);
713 713
 }
714 714
 
715 715
 /**
@@ -724,23 +724,23 @@  discard block
 block discarded – undo
724 724
  * @param string $feed      Optional. Feed type. Default empty.
725 725
  * @return string Link to the feed for the author specified by $author_id.
726 726
  */
727
-function get_author_feed_link( $author_id, $feed = '' ) {
727
+function get_author_feed_link($author_id, $feed = '') {
728 728
 	$author_id = (int) $author_id;
729 729
 	$permalink_structure = get_option('permalink_structure');
730 730
 
731
-	if ( empty($feed) )
731
+	if (empty($feed))
732 732
 		$feed = get_default_feed();
733 733
 
734
-	if ( '' == $permalink_structure ) {
735
-		$link = home_url("?feed=$feed&amp;author=" . $author_id);
734
+	if ('' == $permalink_structure) {
735
+		$link = home_url("?feed=$feed&amp;author=".$author_id);
736 736
 	} else {
737 737
 		$link = get_author_posts_url($author_id);
738
-		if ( $feed == get_default_feed() )
738
+		if ($feed == get_default_feed())
739 739
 			$feed_link = 'feed';
740 740
 		else
741 741
 			$feed_link = "feed/$feed";
742 742
 
743
-		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
743
+		$link = trailingslashit($link).user_trailingslashit($feed_link, 'feed');
744 744
 	}
745 745
 
746 746
 	/**
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	 * @param string $link The author feed link.
752 752
 	 * @param string $feed Feed type.
753 753
 	 */
754
-	$link = apply_filters( 'author_feed_link', $link, $feed );
754
+	$link = apply_filters('author_feed_link', $link, $feed);
755 755
 
756 756
 	return $link;
757 757
 }
@@ -768,8 +768,8 @@  discard block
 block discarded – undo
768 768
  * @param string $feed   Optional. Feed type. Default empty.
769 769
  * @return string Link to the feed for the category specified by $cat_id.
770 770
  */
771
-function get_category_feed_link( $cat_id, $feed = '' ) {
772
-	return get_term_feed_link( $cat_id, 'category', $feed );
771
+function get_category_feed_link($cat_id, $feed = '') {
772
+	return get_term_feed_link($cat_id, 'category', $feed);
773 773
 }
774 774
 
775 775
 /**
@@ -785,40 +785,40 @@  discard block
 block discarded – undo
785 785
  * @param string $feed     Optional. Feed type. Default empty.
786 786
  * @return string|false Link to the feed for the term specified by $term_id and $taxonomy.
787 787
  */
788
-function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
789
-	$term_id = ( int ) $term_id;
788
+function get_term_feed_link($term_id, $taxonomy = 'category', $feed = '') {
789
+	$term_id = (int) $term_id;
790 790
 
791
-	$term = get_term( $term_id, $taxonomy  );
791
+	$term = get_term($term_id, $taxonomy);
792 792
 
793
-	if ( empty( $term ) || is_wp_error( $term ) )
793
+	if (empty($term) || is_wp_error($term))
794 794
 		return false;
795 795
 
796
-	if ( empty( $feed ) )
796
+	if (empty($feed))
797 797
 		$feed = get_default_feed();
798 798
 
799
-	$permalink_structure = get_option( 'permalink_structure' );
799
+	$permalink_structure = get_option('permalink_structure');
800 800
 
801
-	if ( '' == $permalink_structure ) {
802
-		if ( 'category' == $taxonomy ) {
801
+	if ('' == $permalink_structure) {
802
+		if ('category' == $taxonomy) {
803 803
 			$link = home_url("?feed=$feed&amp;cat=$term_id");
804 804
 		}
805
-		elseif ( 'post_tag' == $taxonomy ) {
805
+		elseif ('post_tag' == $taxonomy) {
806 806
 			$link = home_url("?feed=$feed&amp;tag=$term->slug");
807 807
 		} else {
808
-			$t = get_taxonomy( $taxonomy );
808
+			$t = get_taxonomy($taxonomy);
809 809
 			$link = home_url("?feed=$feed&amp;$t->query_var=$term->slug");
810 810
 		}
811 811
 	} else {
812
-		$link = get_term_link( $term_id, $term->taxonomy );
813
-		if ( $feed == get_default_feed() )
812
+		$link = get_term_link($term_id, $term->taxonomy);
813
+		if ($feed == get_default_feed())
814 814
 			$feed_link = 'feed';
815 815
 		else
816 816
 			$feed_link = "feed/$feed";
817 817
 
818
-		$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
818
+		$link = trailingslashit($link).user_trailingslashit($feed_link, 'feed');
819 819
 	}
820 820
 
821
-	if ( 'category' == $taxonomy ) {
821
+	if ('category' == $taxonomy) {
822 822
 		/**
823 823
 		 * Filters the category feed link.
824 824
 		 *
@@ -827,8 +827,8 @@  discard block
 block discarded – undo
827 827
 		 * @param string $link The category feed link.
828 828
 		 * @param string $feed Feed type.
829 829
 		 */
830
-		$link = apply_filters( 'category_feed_link', $link, $feed );
831
-	} elseif ( 'post_tag' == $taxonomy ) {
830
+		$link = apply_filters('category_feed_link', $link, $feed);
831
+	} elseif ('post_tag' == $taxonomy) {
832 832
 		/**
833 833
 		 * Filters the post tag feed link.
834 834
 		 *
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 		 * @param string $link The tag feed link.
838 838
 		 * @param string $feed Feed type.
839 839
 		 */
840
-		$link = apply_filters( 'tag_feed_link', $link, $feed );
840
+		$link = apply_filters('tag_feed_link', $link, $feed);
841 841
 	} else {
842 842
 		/**
843 843
 		 * Filters the feed link for a taxonomy other than 'category' or 'post_tag'.
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 		 * @param string $feed Feed type.
849 849
 		 * @param string $taxonomy The taxonomy name.
850 850
 		 */
851
-		$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
851
+		$link = apply_filters('taxonomy_feed_link', $link, $feed, $taxonomy);
852 852
 	}
853 853
 
854 854
 	return $link;
@@ -863,8 +863,8 @@  discard block
 block discarded – undo
863 863
  * @param string $feed   Optional. Feed type. Default empty.
864 864
  * @return string The feed permalink for the given tag.
865 865
  */
866
-function get_tag_feed_link( $tag_id, $feed = '' ) {
867
-	return get_term_feed_link( $tag_id, 'post_tag', $feed );
866
+function get_tag_feed_link($tag_id, $feed = '') {
867
+	return get_term_feed_link($tag_id, 'post_tag', $feed);
868 868
 }
869 869
 
870 870
 /**
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
  * @param string $taxonomy Optional. Taxonomy slug. Default 'post_tag'.
877 877
  * @return string The edit tag link URL for the given tag.
878 878
  */
879
-function get_edit_tag_link( $tag_id, $taxonomy = 'post_tag' ) {
879
+function get_edit_tag_link($tag_id, $taxonomy = 'post_tag') {
880 880
 	/**
881 881
 	 * Filters the edit link for a tag (or term in another taxonomy).
882 882
 	 *
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 	 *
885 885
 	 * @param string $link The term edit link.
886 886
 	 */
887
-	return apply_filters( 'get_edit_tag_link', get_edit_term_link( $tag_id, $taxonomy ) );
887
+	return apply_filters('get_edit_tag_link', get_edit_term_link($tag_id, $taxonomy));
888 888
 }
889 889
 
890 890
 /**
@@ -898,8 +898,8 @@  discard block
 block discarded – undo
898 898
  * @param WP_Term $tag    Optional. Term object. If null, the queried object will be inspected.
899 899
  *                        Default null.
900 900
  */
901
-function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
902
-	$link = edit_term_link( $link, '', '', $tag, false );
901
+function edit_tag_link($link = '', $before = '', $after = '', $tag = null) {
902
+	$link = edit_term_link($link, '', '', $tag, false);
903 903
 
904 904
 	/**
905 905
 	 * Filters the anchor tag for the edit link for a tag (or term in another taxonomy).
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
 	 *
909 909
 	 * @param string $link The anchor tag for the edit link.
910 910
 	 */
911
-	echo $before . apply_filters( 'edit_tag_link', $link ) . $after;
911
+	echo $before.apply_filters('edit_tag_link', $link).$after;
912 912
 }
913 913
 
914 914
 /**
@@ -925,14 +925,14 @@  discard block
 block discarded – undo
925 925
  *                            with the taxonomy.
926 926
  * @return string|null The edit term link URL for the given term, or null on failure.
927 927
  */
928
-function get_edit_term_link( $term_id, $taxonomy = '', $object_type = '' ) {
929
-	$term = get_term( $term_id, $taxonomy );
930
-	if ( ! $term || is_wp_error( $term ) ) {
928
+function get_edit_term_link($term_id, $taxonomy = '', $object_type = '') {
929
+	$term = get_term($term_id, $taxonomy);
930
+	if ( ! $term || is_wp_error($term)) {
931 931
 		return;
932 932
 	}
933 933
 
934
-	$tax = get_taxonomy( $term->taxonomy );
935
-	if ( ! $tax || ! current_user_can( 'edit_term', $term->term_id ) ) {
934
+	$tax = get_taxonomy($term->taxonomy);
935
+	if ( ! $tax || ! current_user_can('edit_term', $term->term_id)) {
936 936
 		return;
937 937
 	}
938 938
 
@@ -941,14 +941,14 @@  discard block
 block discarded – undo
941 941
 		'tag_ID'   => $term->term_id,
942 942
 	);
943 943
 
944
-	if ( $object_type ) {
944
+	if ($object_type) {
945 945
 		$args['post_type'] = $object_type;
946
-	} elseif ( ! empty( $tax->object_type ) ) {
947
-		$args['post_type'] = reset( $tax->object_type );
946
+	} elseif ( ! empty($tax->object_type)) {
947
+		$args['post_type'] = reset($tax->object_type);
948 948
 	}
949 949
 
950
-	if ( $tax->show_ui ) {
951
-		$location = add_query_arg( $args, admin_url( 'term.php' ) );
950
+	if ($tax->show_ui) {
951
+		$location = add_query_arg($args, admin_url('term.php'));
952 952
 	} else {
953 953
 		$location = '';
954 954
 	}
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 	 * @param string $taxonomy    Taxonomy name.
964 964
 	 * @param string $object_type The object type (eg. the post type).
965 965
 	 */
966
-	return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );
966
+	return apply_filters('get_edit_term_link', $location, $term_id, $taxonomy, $object_type);
967 967
 }
968 968
 
969 969
 /**
@@ -978,22 +978,22 @@  discard block
 block discarded – undo
978 978
  * @param bool   $echo   Optional. Whether or not to echo the return. Default true.
979 979
  * @return string|void HTML content.
980 980
  */
981
-function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {
982
-	if ( is_null( $term ) )
981
+function edit_term_link($link = '', $before = '', $after = '', $term = null, $echo = true) {
982
+	if (is_null($term))
983 983
 		$term = get_queried_object();
984 984
 
985
-	if ( ! $term )
985
+	if ( ! $term)
986 986
 		return;
987 987
 
988
-	$tax = get_taxonomy( $term->taxonomy );
989
-	if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
988
+	$tax = get_taxonomy($term->taxonomy);
989
+	if ( ! current_user_can('edit_term', $term->term_id)) {
990 990
 		return;
991 991
 	}
992 992
 
993
-	if ( empty( $link ) )
993
+	if (empty($link))
994 994
 		$link = __('Edit This');
995 995
 
996
-	$link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '">' . $link . '</a>';
996
+	$link = '<a href="'.get_edit_term_link($term->term_id, $term->taxonomy).'">'.$link.'</a>';
997 997
 
998 998
 	/**
999 999
 	 * Filters the anchor tag for the edit link of a term.
@@ -1003,9 +1003,9 @@  discard block
 block discarded – undo
1003 1003
 	 * @param string $link    The anchor tag for the edit link.
1004 1004
 	 * @param int    $term_id Term ID.
1005 1005
 	 */
1006
-	$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
1006
+	$link = $before.apply_filters('edit_term_link', $link, $term->term_id).$after;
1007 1007
 
1008
-	if ( $echo )
1008
+	if ($echo)
1009 1009
 		echo $link;
1010 1010
 	else
1011 1011
 		return $link;
@@ -1021,23 +1021,23 @@  discard block
 block discarded – undo
1021 1021
  * @param string $query Optional. The query string to use. If empty the current query is used. Default empty.
1022 1022
  * @return string The search permalink.
1023 1023
  */
1024
-function get_search_link( $query = '' ) {
1024
+function get_search_link($query = '') {
1025 1025
 	global $wp_rewrite;
1026 1026
 
1027
-	if ( empty($query) )
1028
-		$search = get_search_query( false );
1027
+	if (empty($query))
1028
+		$search = get_search_query(false);
1029 1029
 	else
1030 1030
 		$search = stripslashes($query);
1031 1031
 
1032 1032
 	$permastruct = $wp_rewrite->get_search_permastruct();
1033 1033
 
1034
-	if ( empty( $permastruct ) ) {
1035
-		$link = home_url('?s=' . urlencode($search) );
1034
+	if (empty($permastruct)) {
1035
+		$link = home_url('?s='.urlencode($search));
1036 1036
 	} else {
1037 1037
 		$search = urlencode($search);
1038 1038
 		$search = str_replace('%2F', '/', $search); // %2F(/) is not valid within a URL, send it un-encoded.
1039
-		$link = str_replace( '%search%', $search, $permastruct );
1040
-		$link = home_url( user_trailingslashit( $link, 'search' ) );
1039
+		$link = str_replace('%search%', $search, $permastruct);
1040
+		$link = home_url(user_trailingslashit($link, 'search'));
1041 1041
 	}
1042 1042
 
1043 1043
 	/**
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 	 * @param string $link   Search permalink.
1049 1049
 	 * @param string $search The URL-encoded search term.
1050 1050
 	 */
1051
-	return apply_filters( 'search_link', $link, $search );
1051
+	return apply_filters('search_link', $link, $search);
1052 1052
 }
1053 1053
 
1054 1054
 /**
@@ -1066,12 +1066,12 @@  discard block
 block discarded – undo
1066 1066
 	global $wp_rewrite;
1067 1067
 	$link = get_search_link($search_query);
1068 1068
 
1069
-	if ( empty($feed) )
1069
+	if (empty($feed))
1070 1070
 		$feed = get_default_feed();
1071 1071
 
1072 1072
 	$permastruct = $wp_rewrite->get_search_permastruct();
1073 1073
 
1074
-	if ( empty($permastruct) ) {
1074
+	if (empty($permastruct)) {
1075 1075
 		$link = add_query_arg('feed', $feed, $link);
1076 1076
 	} else {
1077 1077
 		$link = trailingslashit($link);
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	 * @param string $feed Feed type.
1088 1088
 	 * @param string $type The search type. One of 'posts' or 'comments'.
1089 1089
 	 */
1090
-	return apply_filters( 'search_feed_link', $link, $feed, 'posts' );
1090
+	return apply_filters('search_feed_link', $link, $feed, 'posts');
1091 1091
 }
1092 1092
 
1093 1093
 /**
@@ -1104,20 +1104,20 @@  discard block
 block discarded – undo
1104 1104
 function get_search_comments_feed_link($search_query = '', $feed = '') {
1105 1105
 	global $wp_rewrite;
1106 1106
 
1107
-	if ( empty($feed) )
1107
+	if (empty($feed))
1108 1108
 		$feed = get_default_feed();
1109 1109
 
1110 1110
 	$link = get_search_feed_link($search_query, $feed);
1111 1111
 
1112 1112
 	$permastruct = $wp_rewrite->get_search_permastruct();
1113 1113
 
1114
-	if ( empty($permastruct) )
1115
-		$link = add_query_arg('feed', 'comments-' . $feed, $link);
1114
+	if (empty($permastruct))
1115
+		$link = add_query_arg('feed', 'comments-'.$feed, $link);
1116 1116
 	else
1117 1117
 		$link = add_query_arg('withcomments', 1, $link);
1118 1118
 
1119 1119
 	/** This filter is documented in wp-includes/link-template.php */
1120
-	return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
1120
+	return apply_filters('search_feed_link', $link, $feed, 'comments');
1121 1121
 }
1122 1122
 
1123 1123
 /**
@@ -1131,36 +1131,36 @@  discard block
 block discarded – undo
1131 1131
  * @param string $post_type Post type.
1132 1132
  * @return string|false The post type archive permalink.
1133 1133
  */
1134
-function get_post_type_archive_link( $post_type ) {
1134
+function get_post_type_archive_link($post_type) {
1135 1135
 	global $wp_rewrite;
1136
-	if ( ! $post_type_obj = get_post_type_object( $post_type ) )
1136
+	if ( ! $post_type_obj = get_post_type_object($post_type))
1137 1137
 		return false;
1138 1138
 
1139
-	if ( 'post' === $post_type ) {
1140
-		$show_on_front = get_option( 'show_on_front' );
1141
-		$page_for_posts  = get_option( 'page_for_posts' );
1139
+	if ('post' === $post_type) {
1140
+		$show_on_front = get_option('show_on_front');
1141
+		$page_for_posts = get_option('page_for_posts');
1142 1142
 
1143
-		if ( 'page' == $show_on_front && $page_for_posts ) {
1144
-			$link = get_permalink( $page_for_posts );
1143
+		if ('page' == $show_on_front && $page_for_posts) {
1144
+			$link = get_permalink($page_for_posts);
1145 1145
 		} else {
1146 1146
 			$link = get_home_url();
1147 1147
 		}
1148 1148
 		/** This filter is documented in wp-includes/link-template.php */
1149
-		return apply_filters( 'post_type_archive_link', $link, $post_type );
1149
+		return apply_filters('post_type_archive_link', $link, $post_type);
1150 1150
 	}
1151 1151
 
1152
-	if ( ! $post_type_obj->has_archive )
1152
+	if ( ! $post_type_obj->has_archive)
1153 1153
 		return false;
1154 1154
 
1155
-	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
1156
-		$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
1157
-		if ( $post_type_obj->rewrite['with_front'] )
1158
-			$struct = $wp_rewrite->front . $struct;
1155
+	if (get_option('permalink_structure') && is_array($post_type_obj->rewrite)) {
1156
+		$struct = (true === $post_type_obj->has_archive) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
1157
+		if ($post_type_obj->rewrite['with_front'])
1158
+			$struct = $wp_rewrite->front.$struct;
1159 1159
 		else
1160
-			$struct = $wp_rewrite->root . $struct;
1161
-		$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
1160
+			$struct = $wp_rewrite->root.$struct;
1161
+		$link = home_url(user_trailingslashit($struct, 'post_type_archive'));
1162 1162
 	} else {
1163
-		$link = home_url( '?post_type=' . $post_type );
1163
+		$link = home_url('?post_type='.$post_type);
1164 1164
 	}
1165 1165
 
1166 1166
 	/**
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
 	 * @param string $link      The post type archive permalink.
1172 1172
 	 * @param string $post_type Post type name.
1173 1173
 	 */
1174
-	return apply_filters( 'post_type_archive_link', $link, $post_type );
1174
+	return apply_filters('post_type_archive_link', $link, $post_type);
1175 1175
 }
1176 1176
 
1177 1177
 /**
@@ -1183,22 +1183,22 @@  discard block
 block discarded – undo
1183 1183
  * @param string $feed      Optional. Feed type. Default empty.
1184 1184
  * @return string|false The post type feed permalink.
1185 1185
  */
1186
-function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
1186
+function get_post_type_archive_feed_link($post_type, $feed = '') {
1187 1187
 	$default_feed = get_default_feed();
1188
-	if ( empty( $feed ) )
1188
+	if (empty($feed))
1189 1189
 		$feed = $default_feed;
1190 1190
 
1191
-	if ( ! $link = get_post_type_archive_link( $post_type ) )
1191
+	if ( ! $link = get_post_type_archive_link($post_type))
1192 1192
 		return false;
1193 1193
 
1194
-	$post_type_obj = get_post_type_object( $post_type );
1195
-	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
1196
-		$link = trailingslashit( $link );
1194
+	$post_type_obj = get_post_type_object($post_type);
1195
+	if (get_option('permalink_structure') && is_array($post_type_obj->rewrite) && $post_type_obj->rewrite['feeds']) {
1196
+		$link = trailingslashit($link);
1197 1197
 		$link .= 'feed/';
1198
-		if ( $feed != $default_feed )
1198
+		if ($feed != $default_feed)
1199 1199
 			$link .= "$feed/";
1200 1200
 	} else {
1201
-		$link = add_query_arg( 'feed', $feed, $link );
1201
+		$link = add_query_arg('feed', $feed, $link);
1202 1202
 	}
1203 1203
 
1204 1204
 	/**
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
 	 * @param string $link The post type archive feed link.
1210 1210
 	 * @param string $feed Feed type.
1211 1211
 	 */
1212
-	return apply_filters( 'post_type_archive_feed_link', $link, $feed );
1212
+	return apply_filters('post_type_archive_feed_link', $link, $feed);
1213 1213
 }
1214 1214
 
1215 1215
 /**
@@ -1226,20 +1226,20 @@  discard block
 block discarded – undo
1226 1226
  *                                  post permalink. Default empty.
1227 1227
  * @return string|null URL used for the post preview, or null if the post does not exist.
1228 1228
  */
1229
-function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) {
1230
-	$post = get_post( $post );
1231
-	if ( ! $post ) {
1229
+function get_preview_post_link($post = null, $query_args = array(), $preview_link = '') {
1230
+	$post = get_post($post);
1231
+	if ( ! $post) {
1232 1232
 		return;
1233 1233
 	}
1234 1234
 
1235
-	$post_type_object = get_post_type_object( $post->post_type );
1236
-	if ( is_post_type_viewable( $post_type_object ) ) {
1237
-		if ( ! $preview_link ) {
1238
-			$preview_link = set_url_scheme( get_permalink( $post ) );
1235
+	$post_type_object = get_post_type_object($post->post_type);
1236
+	if (is_post_type_viewable($post_type_object)) {
1237
+		if ( ! $preview_link) {
1238
+			$preview_link = set_url_scheme(get_permalink($post));
1239 1239
 		}
1240 1240
 
1241 1241
 		$query_args['preview'] = 'true';
1242
-		$preview_link = add_query_arg( $query_args, $preview_link );
1242
+		$preview_link = add_query_arg($query_args, $preview_link);
1243 1243
 	}
1244 1244
 
1245 1245
 	/**
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	 * @param string  $preview_link URL used for the post preview.
1252 1252
 	 * @param WP_Post $post         Post object.
1253 1253
 	 */
1254
-	return apply_filters( 'preview_post_link', $preview_link, $post );
1254
+	return apply_filters('preview_post_link', $preview_link, $post);
1255 1255
 }
1256 1256
 
1257 1257
 /**
@@ -1267,26 +1267,26 @@  discard block
 block discarded – undo
1267 1267
  * @return string|null The edit post link for the given post. null if the post type is invalid or does
1268 1268
  *                     not allow an editing UI.
1269 1269
  */
1270
-function get_edit_post_link( $id = 0, $context = 'display' ) {
1271
-	if ( ! $post = get_post( $id ) )
1270
+function get_edit_post_link($id = 0, $context = 'display') {
1271
+	if ( ! $post = get_post($id))
1272 1272
 		return;
1273 1273
 
1274
-	if ( 'revision' === $post->post_type )
1274
+	if ('revision' === $post->post_type)
1275 1275
 		$action = '';
1276
-	elseif ( 'display' == $context )
1276
+	elseif ('display' == $context)
1277 1277
 		$action = '&amp;action=edit';
1278 1278
 	else
1279 1279
 		$action = '&action=edit';
1280 1280
 
1281
-	$post_type_object = get_post_type_object( $post->post_type );
1282
-	if ( !$post_type_object )
1281
+	$post_type_object = get_post_type_object($post->post_type);
1282
+	if ( ! $post_type_object)
1283 1283
 		return;
1284 1284
 
1285
-	if ( !current_user_can( 'edit_post', $post->ID ) )
1285
+	if ( ! current_user_can('edit_post', $post->ID))
1286 1286
 		return;
1287 1287
 
1288
-	if ( $post_type_object->_edit_link ) {
1289
-		$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
1288
+	if ($post_type_object->_edit_link) {
1289
+		$link = admin_url(sprintf($post_type_object->_edit_link.$action, $post->ID));
1290 1290
 	} else {
1291 1291
 		$link = '';
1292 1292
 	}
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	 * @param string $context The link context. If set to 'display' then ampersands
1302 1302
 	 *                        are encoded.
1303 1303
 	 */
1304
-	return apply_filters( 'get_edit_post_link', $link, $post->ID, $context );
1304
+	return apply_filters('get_edit_post_link', $link, $post->ID, $context);
1305 1305
 }
1306 1306
 
1307 1307
 /**
@@ -1316,20 +1316,20 @@  discard block
 block discarded – undo
1316 1316
  * @param int    $id     Optional. Post ID. Default is the ID of the global `$post`.
1317 1317
  * @param string $class  Optional. Add custom class to link. Default 'post-edit-link'.
1318 1318
  */
1319
-function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) {
1320
-	if ( ! $post = get_post( $id ) ) {
1319
+function edit_post_link($text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link') {
1320
+	if ( ! $post = get_post($id)) {
1321 1321
 		return;
1322 1322
 	}
1323 1323
 
1324
-	if ( ! $url = get_edit_post_link( $post->ID ) ) {
1324
+	if ( ! $url = get_edit_post_link($post->ID)) {
1325 1325
 		return;
1326 1326
 	}
1327 1327
 
1328
-	if ( null === $text ) {
1329
-		$text = __( 'Edit This' );
1328
+	if (null === $text) {
1329
+		$text = __('Edit This');
1330 1330
 	}
1331 1331
 
1332
-	$link = '<a class="' . esc_attr( $class ) . '" href="' . esc_url( $url ) . '">' . $text . '</a>';
1332
+	$link = '<a class="'.esc_attr($class).'" href="'.esc_url($url).'">'.$text.'</a>';
1333 1333
 
1334 1334
 	/**
1335 1335
 	 * Filters the post edit link anchor tag.
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
 	 * @param int    $post_id Post ID.
1341 1341
 	 * @param string $text    Anchor text.
1342 1342
 	 */
1343
-	echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;
1343
+	echo $before.apply_filters('edit_post_link', $link, $post->ID, $text).$after;
1344 1344
 }
1345 1345
 
1346 1346
 /**
@@ -1355,23 +1355,23 @@  discard block
 block discarded – undo
1355 1355
  * @param bool   $force_delete Optional. Whether to bypass trash and force deletion. Default false.
1356 1356
  * @return string|void The delete post link URL for the given post.
1357 1357
  */
1358
-function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {
1359
-	if ( ! empty( $deprecated ) )
1360
-		_deprecated_argument( __FUNCTION__, '3.0.0' );
1358
+function get_delete_post_link($id = 0, $deprecated = '', $force_delete = false) {
1359
+	if ( ! empty($deprecated))
1360
+		_deprecated_argument(__FUNCTION__, '3.0.0');
1361 1361
 
1362
-	if ( !$post = get_post( $id ) )
1362
+	if ( ! $post = get_post($id))
1363 1363
 		return;
1364 1364
 
1365
-	$post_type_object = get_post_type_object( $post->post_type );
1366
-	if ( !$post_type_object )
1365
+	$post_type_object = get_post_type_object($post->post_type);
1366
+	if ( ! $post_type_object)
1367 1367
 		return;
1368 1368
 
1369
-	if ( !current_user_can( 'delete_post', $post->ID ) )
1369
+	if ( ! current_user_can('delete_post', $post->ID))
1370 1370
 		return;
1371 1371
 
1372
-	$action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
1372
+	$action = ($force_delete || ! EMPTY_TRASH_DAYS) ? 'delete' : 'trash';
1373 1373
 
1374
-	$delete_link = add_query_arg( 'action', $action, admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) );
1374
+	$delete_link = add_query_arg('action', $action, admin_url(sprintf($post_type_object->_edit_link, $post->ID)));
1375 1375
 
1376 1376
 	/**
1377 1377
 	 * Filters the post delete link.
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
 	 * @param int    $post_id      Post ID.
1383 1383
 	 * @param bool   $force_delete Whether to bypass the trash and force deletion. Default false.
1384 1384
 	 */
1385
-	return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete );
1385
+	return apply_filters('get_delete_post_link', wp_nonce_url($delete_link, "$action-post_{$post->ID}"), $post->ID, $force_delete);
1386 1386
 }
1387 1387
 
1388 1388
 /**
@@ -1393,13 +1393,13 @@  discard block
 block discarded – undo
1393 1393
  * @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.
1394 1394
  * @return string|void The edit comment link URL for the given comment.
1395 1395
  */
1396
-function get_edit_comment_link( $comment_id = 0 ) {
1397
-	$comment = get_comment( $comment_id );
1396
+function get_edit_comment_link($comment_id = 0) {
1397
+	$comment = get_comment($comment_id);
1398 1398
 
1399
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
1399
+	if ( ! current_user_can('edit_comment', $comment->comment_ID))
1400 1400
 		return;
1401 1401
 
1402
-	$location = admin_url('comment.php?action=editcomment&amp;c=') . $comment->comment_ID;
1402
+	$location = admin_url('comment.php?action=editcomment&amp;c=').$comment->comment_ID;
1403 1403
 
1404 1404
 	/**
1405 1405
 	 * Filters the comment edit link.
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 	 *
1409 1409
 	 * @param string $location The edit link.
1410 1410
 	 */
1411
-	return apply_filters( 'get_edit_comment_link', $location );
1411
+	return apply_filters('get_edit_comment_link', $location);
1412 1412
 }
1413 1413
 
1414 1414
 /**
@@ -1420,18 +1420,18 @@  discard block
 block discarded – undo
1420 1420
  * @param string $before Optional. Display before edit link. Default empty.
1421 1421
  * @param string $after  Optional. Display after edit link. Default empty.
1422 1422
  */
1423
-function edit_comment_link( $text = null, $before = '', $after = '' ) {
1423
+function edit_comment_link($text = null, $before = '', $after = '') {
1424 1424
 	$comment = get_comment();
1425 1425
 
1426
-	if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
1426
+	if ( ! current_user_can('edit_comment', $comment->comment_ID)) {
1427 1427
 		return;
1428 1428
 	}
1429 1429
 
1430
-	if ( null === $text ) {
1431
-		$text = __( 'Edit This' );
1430
+	if (null === $text) {
1431
+		$text = __('Edit This');
1432 1432
 	}
1433 1433
 
1434
-	$link = '<a class="comment-edit-link" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>';
1434
+	$link = '<a class="comment-edit-link" href="'.esc_url(get_edit_comment_link($comment)).'">'.$text.'</a>';
1435 1435
 
1436 1436
 	/**
1437 1437
 	 * Filters the comment edit link anchor tag.
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 	 * @param int    $comment_id Comment ID.
1443 1443
 	 * @param string $text       Anchor text.
1444 1444
 	 */
1445
-	echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after;
1445
+	echo $before.apply_filters('edit_comment_link', $link, $comment->comment_ID, $text).$after;
1446 1446
 }
1447 1447
 
1448 1448
 /**
@@ -1453,13 +1453,13 @@  discard block
 block discarded – undo
1453 1453
  * @param int|stdClass $link Optional. Bookmark ID. Default is the id of the current bookmark.
1454 1454
  * @return string|void The edit bookmark link URL.
1455 1455
  */
1456
-function get_edit_bookmark_link( $link = 0 ) {
1457
-	$link = get_bookmark( $link );
1456
+function get_edit_bookmark_link($link = 0) {
1457
+	$link = get_bookmark($link);
1458 1458
 
1459
-	if ( !current_user_can('manage_links') )
1459
+	if ( ! current_user_can('manage_links'))
1460 1460
 		return;
1461 1461
 
1462
-	$location = admin_url('link.php?action=edit&amp;link_id=') . $link->link_id;
1462
+	$location = admin_url('link.php?action=edit&amp;link_id=').$link->link_id;
1463 1463
 
1464 1464
 	/**
1465 1465
 	 * Filters the bookmark edit link.
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 	 * @param string $location The edit link.
1470 1470
 	 * @param int    $link_id  Bookmark ID.
1471 1471
 	 */
1472
-	return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );
1472
+	return apply_filters('get_edit_bookmark_link', $location, $link->link_id);
1473 1473
 }
1474 1474
 
1475 1475
 /**
@@ -1482,16 +1482,16 @@  discard block
 block discarded – undo
1482 1482
  * @param string $after    Optional. Display after edit link. Default empty.
1483 1483
  * @param int    $bookmark Optional. Bookmark ID. Default is the current bookmark.
1484 1484
  */
1485
-function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
1485
+function edit_bookmark_link($link = '', $before = '', $after = '', $bookmark = null) {
1486 1486
 	$bookmark = get_bookmark($bookmark);
1487 1487
 
1488
-	if ( !current_user_can('manage_links') )
1488
+	if ( ! current_user_can('manage_links'))
1489 1489
 		return;
1490 1490
 
1491
-	if ( empty($link) )
1491
+	if (empty($link))
1492 1492
 		$link = __('Edit This');
1493 1493
 
1494
-	$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';
1494
+	$link = '<a href="'.esc_url(get_edit_bookmark_link($bookmark)).'">'.$link.'</a>';
1495 1495
 
1496 1496
 	/**
1497 1497
 	 * Filters the bookmark edit link anchor tag.
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 	 * @param string $link    Anchor tag for the edit link.
1502 1502
 	 * @param int    $link_id Bookmark ID.
1503 1503
 	 */
1504
-	echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
1504
+	echo $before.apply_filters('edit_bookmark_link', $link, $bookmark->link_id).$after;
1505 1505
 }
1506 1506
 
1507 1507
 /**
@@ -1512,22 +1512,22 @@  discard block
 block discarded – undo
1512 1512
  * @param int $user_id Optional. User ID. Defaults to the current user.
1513 1513
  * @return string URL to edit user page or empty string.
1514 1514
  */
1515
-function get_edit_user_link( $user_id = null ) {
1516
-	if ( ! $user_id )
1515
+function get_edit_user_link($user_id = null) {
1516
+	if ( ! $user_id)
1517 1517
 		$user_id = get_current_user_id();
1518 1518
 
1519
-	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
1519
+	if (empty($user_id) || ! current_user_can('edit_user', $user_id))
1520 1520
 		return '';
1521 1521
 
1522
-	$user = get_userdata( $user_id );
1522
+	$user = get_userdata($user_id);
1523 1523
 
1524
-	if ( ! $user )
1524
+	if ( ! $user)
1525 1525
 		return '';
1526 1526
 
1527
-	if ( get_current_user_id() == $user->ID )
1528
-		$link = get_edit_profile_url( $user->ID );
1527
+	if (get_current_user_id() == $user->ID)
1528
+		$link = get_edit_profile_url($user->ID);
1529 1529
 	else
1530
-		$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
1530
+		$link = add_query_arg('user_id', $user->ID, self_admin_url('user-edit.php'));
1531 1531
 
1532 1532
 	/**
1533 1533
 	 * Filters the user edit link.
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 	 * @param string $link    The edit link.
1538 1538
 	 * @param int    $user_id User ID.
1539 1539
 	 */
1540
-	return apply_filters( 'get_edit_user_link', $link, $user->ID );
1540
+	return apply_filters('get_edit_user_link', $link, $user->ID);
1541 1541
 }
1542 1542
 
1543 1543
 // Navigation links
@@ -1553,8 +1553,8 @@  discard block
 block discarded – undo
1553 1553
  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
1554 1554
  *                             corresponding post exists.
1555 1555
  */
1556
-function get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1557
-	return get_adjacent_post( $in_same_term, $excluded_terms, true, $taxonomy );
1556
+function get_previous_post($in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1557
+	return get_adjacent_post($in_same_term, $excluded_terms, true, $taxonomy);
1558 1558
 }
1559 1559
 
1560 1560
 /**
@@ -1568,8 +1568,8 @@  discard block
 block discarded – undo
1568 1568
  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
1569 1569
  *                             corresponding post exists.
1570 1570
  */
1571
-function get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1572
-	return get_adjacent_post( $in_same_term, $excluded_terms, false, $taxonomy );
1571
+function get_next_post($in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1572
+	return get_adjacent_post($in_same_term, $excluded_terms, false, $taxonomy);
1573 1573
 }
1574 1574
 
1575 1575
 /**
@@ -1588,10 +1588,10 @@  discard block
 block discarded – undo
1588 1588
  * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no
1589 1589
  *                             corresponding post exists.
1590 1590
  */
1591
-function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
1591
+function get_adjacent_post($in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category') {
1592 1592
 	global $wpdb;
1593 1593
 
1594
-	if ( ( ! $post = get_post() ) || ! taxonomy_exists( $taxonomy ) )
1594
+	if (( ! $post = get_post()) || ! taxonomy_exists($taxonomy))
1595 1595
 		return null;
1596 1596
 
1597 1597
 	$current_post_date = $post->post_date;
@@ -1600,35 +1600,35 @@  discard block
 block discarded – undo
1600 1600
 	$where = '';
1601 1601
 	$adjacent = $previous ? 'previous' : 'next';
1602 1602
 
1603
-	if ( $in_same_term || ! empty( $excluded_terms ) ) {
1604
-		if ( ! empty( $excluded_terms ) && ! is_array( $excluded_terms ) ) {
1603
+	if ($in_same_term || ! empty($excluded_terms)) {
1604
+		if ( ! empty($excluded_terms) && ! is_array($excluded_terms)) {
1605 1605
 			// back-compat, $excluded_terms used to be $excluded_terms with IDs separated by " and "
1606
-			if ( false !== strpos( $excluded_terms, ' and ' ) ) {
1607
-				_deprecated_argument( __FUNCTION__, '3.3.0', sprintf( __( 'Use commas instead of %s to separate excluded terms.' ), "'and'" ) );
1608
-				$excluded_terms = explode( ' and ', $excluded_terms );
1606
+			if (false !== strpos($excluded_terms, ' and ')) {
1607
+				_deprecated_argument(__FUNCTION__, '3.3.0', sprintf(__('Use commas instead of %s to separate excluded terms.'), "'and'"));
1608
+				$excluded_terms = explode(' and ', $excluded_terms);
1609 1609
 			} else {
1610
-				$excluded_terms = explode( ',', $excluded_terms );
1610
+				$excluded_terms = explode(',', $excluded_terms);
1611 1611
 			}
1612 1612
 
1613
-			$excluded_terms = array_map( 'intval', $excluded_terms );
1613
+			$excluded_terms = array_map('intval', $excluded_terms);
1614 1614
 		}
1615 1615
 
1616
-		if ( $in_same_term ) {
1616
+		if ($in_same_term) {
1617 1617
 			$join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
1618
-			$where .= $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
1618
+			$where .= $wpdb->prepare("AND tt.taxonomy = %s", $taxonomy);
1619 1619
 
1620
-			if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) )
1620
+			if ( ! is_object_in_taxonomy($post->post_type, $taxonomy))
1621 1621
 				return '';
1622
-			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
1622
+			$term_array = wp_get_object_terms($post->ID, $taxonomy, array('fields' => 'ids'));
1623 1623
 
1624 1624
 			// Remove any exclusions from the term array to include.
1625
-			$term_array = array_diff( $term_array, (array) $excluded_terms );
1626
-			$term_array = array_map( 'intval', $term_array );
1625
+			$term_array = array_diff($term_array, (array) $excluded_terms);
1626
+			$term_array = array_map('intval', $term_array);
1627 1627
 
1628
-			if ( ! $term_array || is_wp_error( $term_array ) )
1628
+			if ( ! $term_array || is_wp_error($term_array))
1629 1629
 				return '';
1630 1630
 
1631
-			$where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
1631
+			$where .= " AND tt.term_id IN (".implode(',', $term_array).")";
1632 1632
 		}
1633 1633
 
1634 1634
 		/**
@@ -1641,21 +1641,21 @@  discard block
 block discarded – undo
1641 1641
 		 *
1642 1642
 		 * @param string $excluded_terms Array of excluded term IDs.
1643 1643
 		 */
1644
-		$excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
1644
+		$excluded_terms = apply_filters("get_{$adjacent}_post_excluded_terms", $excluded_terms);
1645 1645
 
1646
-		if ( ! empty( $excluded_terms ) ) {
1647
-			$where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( ',', array_map( 'intval', $excluded_terms ) ) . ') )';
1646
+		if ( ! empty($excluded_terms)) {
1647
+			$where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (".implode(',', array_map('intval', $excluded_terms)).') )';
1648 1648
 		}
1649 1649
 	}
1650 1650
 
1651 1651
 	// 'post_status' clause depends on the current user.
1652
-	if ( is_user_logged_in() ) {
1652
+	if (is_user_logged_in()) {
1653 1653
 		$user_id = get_current_user_id();
1654 1654
 
1655
-		$post_type_object = get_post_type_object( $post->post_type );
1656
-		if ( empty( $post_type_object ) ) {
1655
+		$post_type_object = get_post_type_object($post->post_type);
1656
+		if (empty($post_type_object)) {
1657 1657
 			$post_type_cap    = $post->post_type;
1658
-			$read_private_cap = 'read_private_' . $post_type_cap . 's';
1658
+			$read_private_cap = 'read_private_'.$post_type_cap.'s';
1659 1659
 		} else {
1660 1660
 			$read_private_cap = $post_type_object->cap->read_private_posts;
1661 1661
 		}
@@ -1664,13 +1664,13 @@  discard block
 block discarded – undo
1664 1664
 		 * Results should include private posts belonging to the current user, or private posts where the
1665 1665
 		 * current user has the 'read_private_posts' cap.
1666 1666
 		 */
1667
-		$private_states = get_post_stati( array( 'private' => true ) );
1667
+		$private_states = get_post_stati(array('private' => true));
1668 1668
 		$where .= " AND ( p.post_status = 'publish'";
1669
-		foreach ( (array) $private_states as $state ) {
1670
-			if ( current_user_can( $read_private_cap ) ) {
1671
-				$where .= $wpdb->prepare( " OR p.post_status = %s", $state );
1669
+		foreach ((array) $private_states as $state) {
1670
+			if (current_user_can($read_private_cap)) {
1671
+				$where .= $wpdb->prepare(" OR p.post_status = %s", $state);
1672 1672
 			} else {
1673
-				$where .= $wpdb->prepare( " OR (p.post_author = %d AND p.post_status = %s)", $user_id, $state );
1673
+				$where .= $wpdb->prepare(" OR (p.post_author = %d AND p.post_status = %s)", $user_id, $state);
1674 1674
 			}
1675 1675
 		}
1676 1676
 		$where .= " )";
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 	 * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
1697 1697
 	 * @param WP_Post $post           WP_Post object.
1698 1698
 	 */
1699
-	$join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post );
1699
+	$join = apply_filters("get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post);
1700 1700
 
1701 1701
 	/**
1702 1702
 	 * Filters the WHERE clause in the SQL for an adjacent post query.
@@ -1713,7 +1713,7 @@  discard block
 block discarded – undo
1713 1713
 	 * @param string $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.
1714 1714
 	 * @param WP_Post $post           WP_Post object.
1715 1715
 	 */
1716
-	$where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy, $post );
1716
+	$where = apply_filters("get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type), $in_same_term, $excluded_terms, $taxonomy, $post);
1717 1717
 
1718 1718
 	/**
1719 1719
 	 * Filters the ORDER BY clause in the SQL for an adjacent post query.
@@ -1727,25 +1727,25 @@  discard block
 block discarded – undo
1727 1727
 	 * @param string $order_by The `ORDER BY` clause in the SQL.
1728 1728
 	 * @param WP_Post $post    WP_Post object.
1729 1729
 	 */
1730
-	$sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post );
1730
+	$sort  = apply_filters("get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post);
1731 1731
 
1732 1732
 	$query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort";
1733
-	$query_key = 'adjacent_post_' . md5( $query );
1734
-	$result = wp_cache_get( $query_key, 'counts' );
1735
-	if ( false !== $result ) {
1736
-		if ( $result )
1737
-			$result = get_post( $result );
1733
+	$query_key = 'adjacent_post_'.md5($query);
1734
+	$result = wp_cache_get($query_key, 'counts');
1735
+	if (false !== $result) {
1736
+		if ($result)
1737
+			$result = get_post($result);
1738 1738
 		return $result;
1739 1739
 	}
1740 1740
 
1741
-	$result = $wpdb->get_var( $query );
1742
-	if ( null === $result )
1741
+	$result = $wpdb->get_var($query);
1742
+	if (null === $result)
1743 1743
 		$result = '';
1744 1744
 
1745
-	wp_cache_set( $query_key, $result, 'counts' );
1745
+	wp_cache_set($query_key, $result, 'counts');
1746 1746
 
1747
-	if ( $result )
1748
-		$result = get_post( $result );
1747
+	if ($result)
1748
+		$result = get_post($result);
1749 1749
 
1750 1750
 	return $result;
1751 1751
 }
@@ -1764,28 +1764,28 @@  discard block
 block discarded – undo
1764 1764
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1765 1765
  * @return string|void The adjacent post relational link URL.
1766 1766
  */
1767
-function get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
1768
-	if ( $previous && is_attachment() && $post = get_post() )
1769
-		$post = get_post( $post->post_parent );
1767
+function get_adjacent_post_rel_link($title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category') {
1768
+	if ($previous && is_attachment() && $post = get_post())
1769
+		$post = get_post($post->post_parent);
1770 1770
 	else
1771
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
1771
+		$post = get_adjacent_post($in_same_term, $excluded_terms, $previous, $taxonomy);
1772 1772
 
1773
-	if ( empty( $post ) )
1773
+	if (empty($post))
1774 1774
 		return;
1775 1775
 
1776
-	$post_title = the_title_attribute( array( 'echo' => false, 'post' => $post ) );
1776
+	$post_title = the_title_attribute(array('echo' => false, 'post' => $post));
1777 1777
 
1778
-	if ( empty( $post_title ) )
1779
-		$post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
1778
+	if (empty($post_title))
1779
+		$post_title = $previous ? __('Previous Post') : __('Next Post');
1780 1780
 
1781
-	$date = mysql2date( get_option( 'date_format' ), $post->post_date );
1781
+	$date = mysql2date(get_option('date_format'), $post->post_date);
1782 1782
 
1783
-	$title = str_replace( '%title', $post_title, $title );
1784
-	$title = str_replace( '%date', $date, $title );
1783
+	$title = str_replace('%title', $post_title, $title);
1784
+	$title = str_replace('%date', $date, $title);
1785 1785
 
1786 1786
 	$link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
1787
-	$link .= esc_attr( $title );
1788
-	$link .= "' href='" . get_permalink( $post ) . "' />\n";
1787
+	$link .= esc_attr($title);
1788
+	$link .= "' href='".get_permalink($post)."' />\n";
1789 1789
 
1790 1790
 	$adjacent = $previous ? 'previous' : 'next';
1791 1791
 
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 	 *
1800 1800
 	 * @param string $link The relational link.
1801 1801
 	 */
1802
-	return apply_filters( "{$adjacent}_post_rel_link", $link );
1802
+	return apply_filters("{$adjacent}_post_rel_link", $link);
1803 1803
 }
1804 1804
 
1805 1805
 /**
@@ -1812,9 +1812,9 @@  discard block
 block discarded – undo
1812 1812
  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1813 1813
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1814 1814
  */
1815
-function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1816
-	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );
1817
-	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );
1815
+function adjacent_posts_rel_link($title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1816
+	echo get_adjacent_post_rel_link($title, $in_same_term, $excluded_terms, true, $taxonomy);
1817
+	echo get_adjacent_post_rel_link($title, $in_same_term, $excluded_terms, false, $taxonomy);
1818 1818
 }
1819 1819
 
1820 1820
 /**
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
  * @see adjacent_posts_rel_link()
1829 1829
  */
1830 1830
 function adjacent_posts_rel_link_wp_head() {
1831
-	if ( ! is_single() || is_attachment() ) {
1831
+	if ( ! is_single() || is_attachment()) {
1832 1832
 		return;
1833 1833
 	}
1834 1834
 	adjacent_posts_rel_link();
@@ -1846,8 +1846,8 @@  discard block
 block discarded – undo
1846 1846
  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1847 1847
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1848 1848
  */
1849
-function next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1850
-	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );
1849
+function next_post_rel_link($title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1850
+	echo get_adjacent_post_rel_link($title, $in_same_term, $excluded_terms, false, $taxonomy);
1851 1851
 }
1852 1852
 
1853 1853
 /**
@@ -1862,8 +1862,8 @@  discard block
 block discarded – undo
1862 1862
  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true.
1863 1863
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1864 1864
  */
1865
-function prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1866
-	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );
1865
+function prev_post_rel_link($title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1866
+	echo get_adjacent_post_rel_link($title, $in_same_term, $excluded_terms, true, $taxonomy);
1867 1867
 }
1868 1868
 
1869 1869
 /**
@@ -1882,9 +1882,9 @@  discard block
 block discarded – undo
1882 1882
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1883 1883
  * @return null|array Array containing the boundary post object if successful, null otherwise.
1884 1884
  */
1885
-function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) {
1885
+function get_boundary_post($in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category') {
1886 1886
 	$post = get_post();
1887
-	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) )
1887
+	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists($taxonomy))
1888 1888
 		return null;
1889 1889
 
1890 1890
 	$query_args = array(
@@ -1896,34 +1896,34 @@  discard block
 block discarded – undo
1896 1896
 
1897 1897
 	$term_array = array();
1898 1898
 
1899
-	if ( ! is_array( $excluded_terms ) ) {
1900
-		if ( ! empty( $excluded_terms ) )
1901
-			$excluded_terms = explode( ',', $excluded_terms );
1899
+	if ( ! is_array($excluded_terms)) {
1900
+		if ( ! empty($excluded_terms))
1901
+			$excluded_terms = explode(',', $excluded_terms);
1902 1902
 		else
1903 1903
 			$excluded_terms = array();
1904 1904
 	}
1905 1905
 
1906
-	if ( $in_same_term || ! empty( $excluded_terms ) ) {
1907
-		if ( $in_same_term )
1908
-			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
1906
+	if ($in_same_term || ! empty($excluded_terms)) {
1907
+		if ($in_same_term)
1908
+			$term_array = wp_get_object_terms($post->ID, $taxonomy, array('fields' => 'ids'));
1909 1909
 
1910
-		if ( ! empty( $excluded_terms ) ) {
1911
-			$excluded_terms = array_map( 'intval', $excluded_terms );
1912
-			$excluded_terms = array_diff( $excluded_terms, $term_array );
1910
+		if ( ! empty($excluded_terms)) {
1911
+			$excluded_terms = array_map('intval', $excluded_terms);
1912
+			$excluded_terms = array_diff($excluded_terms, $term_array);
1913 1913
 
1914 1914
 			$inverse_terms = array();
1915
-			foreach ( $excluded_terms as $excluded_term )
1915
+			foreach ($excluded_terms as $excluded_term)
1916 1916
 				$inverse_terms[] = $excluded_term * -1;
1917 1917
 			$excluded_terms = $inverse_terms;
1918 1918
 		}
1919 1919
 
1920
-		$query_args[ 'tax_query' ] = array( array(
1920
+		$query_args['tax_query'] = array(array(
1921 1921
 			'taxonomy' => $taxonomy,
1922
-			'terms' => array_merge( $term_array, $excluded_terms )
1923
-		) );
1922
+			'terms' => array_merge($term_array, $excluded_terms)
1923
+		));
1924 1924
 	}
1925 1925
 
1926
-	return get_posts( $query_args );
1926
+	return get_posts($query_args);
1927 1927
 }
1928 1928
 
1929 1929
 /**
@@ -1938,8 +1938,8 @@  discard block
 block discarded – undo
1938 1938
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1939 1939
  * @return string The link URL of the previous post in relation to the current post.
1940 1940
  */
1941
-function get_previous_post_link( $format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1942
-	return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, true, $taxonomy );
1941
+function get_previous_post_link($format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1942
+	return get_adjacent_post_link($format, $link, $in_same_term, $excluded_terms, true, $taxonomy);
1943 1943
 }
1944 1944
 
1945 1945
 /**
@@ -1955,8 +1955,8 @@  discard block
 block discarded – undo
1955 1955
  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1956 1956
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1957 1957
  */
1958
-function previous_post_link( $format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1959
-	echo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
1958
+function previous_post_link($format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1959
+	echo get_previous_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
1960 1960
 }
1961 1961
 
1962 1962
 /**
@@ -1971,8 +1971,8 @@  discard block
 block discarded – undo
1971 1971
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1972 1972
  * @return string The link URL of the next post in relation to the current post.
1973 1973
  */
1974
-function get_next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1975
-	return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy );
1974
+function get_next_post_link($format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1975
+	return get_adjacent_post_link($format, $link, $in_same_term, $excluded_terms, false, $taxonomy);
1976 1976
 }
1977 1977
 
1978 1978
 /**
@@ -1987,8 +1987,8 @@  discard block
 block discarded – undo
1987 1987
  * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
1988 1988
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
1989 1989
  */
1990
-function next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
1991
-	 echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
1990
+function next_post_link($format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category') {
1991
+	 echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
1992 1992
 }
1993 1993
 
1994 1994
 /**
@@ -2006,32 +2006,32 @@  discard block
 block discarded – undo
2006 2006
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
2007 2007
  * @return string The link URL of the previous or next post in relation to the current post.
2008 2008
  */
2009
-function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
2010
-	if ( $previous && is_attachment() )
2011
-		$post = get_post( get_post()->post_parent );
2009
+function get_adjacent_post_link($format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category') {
2010
+	if ($previous && is_attachment())
2011
+		$post = get_post(get_post()->post_parent);
2012 2012
 	else
2013
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
2013
+		$post = get_adjacent_post($in_same_term, $excluded_terms, $previous, $taxonomy);
2014 2014
 
2015
-	if ( ! $post ) {
2015
+	if ( ! $post) {
2016 2016
 		$output = '';
2017 2017
 	} else {
2018 2018
 		$title = $post->post_title;
2019 2019
 
2020
-		if ( empty( $post->post_title ) )
2021
-			$title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
2020
+		if (empty($post->post_title))
2021
+			$title = $previous ? __('Previous Post') : __('Next Post');
2022 2022
 
2023 2023
 		/** This filter is documented in wp-includes/post-template.php */
2024
-		$title = apply_filters( 'the_title', $title, $post->ID );
2024
+		$title = apply_filters('the_title', $title, $post->ID);
2025 2025
 
2026
-		$date = mysql2date( get_option( 'date_format' ), $post->post_date );
2026
+		$date = mysql2date(get_option('date_format'), $post->post_date);
2027 2027
 		$rel = $previous ? 'prev' : 'next';
2028 2028
 
2029
-		$string = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">';
2030
-		$inlink = str_replace( '%title', $title, $link );
2031
-		$inlink = str_replace( '%date', $date, $inlink );
2032
-		$inlink = $string . $inlink . '</a>';
2029
+		$string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
2030
+		$inlink = str_replace('%title', $title, $link);
2031
+		$inlink = str_replace('%date', $date, $inlink);
2032
+		$inlink = $string.$inlink.'</a>';
2033 2033
 
2034
-		$output = str_replace( '%link', $inlink, $format );
2034
+		$output = str_replace('%link', $inlink, $format);
2035 2035
 	}
2036 2036
 
2037 2037
 	$adjacent = $previous ? 'previous' : 'next';
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 	 * @param WP_Post $post     The adjacent post.
2052 2052
 	 * @param string  $adjacent Whether the post is previous or next.
2053 2053
 	 */
2054
-	return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );
2054
+	return apply_filters("{$adjacent}_post_link", $output, $format, $link, $post, $adjacent);
2055 2055
 }
2056 2056
 
2057 2057
 /**
@@ -2068,8 +2068,8 @@  discard block
 block discarded – undo
2068 2068
  * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
2069 2069
  * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
2070 2070
  */
2071
-function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
2072
-	echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );
2071
+function adjacent_post_link($format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category') {
2072
+	echo get_adjacent_post_link($format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy);
2073 2073
 }
2074 2074
 
2075 2075
 /**
@@ -2084,53 +2084,53 @@  discard block
 block discarded – undo
2084 2084
  * 	                    Otherwise, prepares the URL with esc_url_raw().
2085 2085
  * @return string The link URL for the given page number.
2086 2086
  */
2087
-function get_pagenum_link($pagenum = 1, $escape = true ) {
2087
+function get_pagenum_link($pagenum = 1, $escape = true) {
2088 2088
 	global $wp_rewrite;
2089 2089
 
2090 2090
 	$pagenum = (int) $pagenum;
2091 2091
 
2092
-	$request = remove_query_arg( 'paged' );
2092
+	$request = remove_query_arg('paged');
2093 2093
 
2094 2094
 	$home_root = parse_url(home_url());
2095
-	$home_root = ( isset($home_root['path']) ) ? $home_root['path'] : '';
2096
-	$home_root = preg_quote( $home_root, '|' );
2095
+	$home_root = (isset($home_root['path'])) ? $home_root['path'] : '';
2096
+	$home_root = preg_quote($home_root, '|');
2097 2097
 
2098
-	$request = preg_replace('|^'. $home_root . '|i', '', $request);
2098
+	$request = preg_replace('|^'.$home_root.'|i', '', $request);
2099 2099
 	$request = preg_replace('|^/+|', '', $request);
2100 2100
 
2101
-	if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
2102
-		$base = trailingslashit( get_bloginfo( 'url' ) );
2101
+	if ( ! $wp_rewrite->using_permalinks() || is_admin()) {
2102
+		$base = trailingslashit(get_bloginfo('url'));
2103 2103
 
2104
-		if ( $pagenum > 1 ) {
2105
-			$result = add_query_arg( 'paged', $pagenum, $base . $request );
2104
+		if ($pagenum > 1) {
2105
+			$result = add_query_arg('paged', $pagenum, $base.$request);
2106 2106
 		} else {
2107
-			$result = $base . $request;
2107
+			$result = $base.$request;
2108 2108
 		}
2109 2109
 	} else {
2110 2110
 		$qs_regex = '|\?.*?$|';
2111
-		preg_match( $qs_regex, $request, $qs_match );
2111
+		preg_match($qs_regex, $request, $qs_match);
2112 2112
 
2113
-		if ( !empty( $qs_match[0] ) ) {
2113
+		if ( ! empty($qs_match[0])) {
2114 2114
 			$query_string = $qs_match[0];
2115
-			$request = preg_replace( $qs_regex, '', $request );
2115
+			$request = preg_replace($qs_regex, '', $request);
2116 2116
 		} else {
2117 2117
 			$query_string = '';
2118 2118
 		}
2119 2119
 
2120
-		$request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);
2121
-		$request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request);
2120
+		$request = preg_replace("|$wp_rewrite->pagination_base/\d+/?$|", '', $request);
2121
+		$request = preg_replace('|^'.preg_quote($wp_rewrite->index, '|').'|i', '', $request);
2122 2122
 		$request = ltrim($request, '/');
2123 2123
 
2124
-		$base = trailingslashit( get_bloginfo( 'url' ) );
2124
+		$base = trailingslashit(get_bloginfo('url'));
2125 2125
 
2126
-		if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
2127
-			$base .= $wp_rewrite->index . '/';
2126
+		if ($wp_rewrite->using_index_permalinks() && ($pagenum > 1 || '' != $request))
2127
+			$base .= $wp_rewrite->index.'/';
2128 2128
 
2129
-		if ( $pagenum > 1 ) {
2130
-			$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
2129
+		if ($pagenum > 1) {
2130
+			$request = (( ! empty($request)) ? trailingslashit($request) : $request).user_trailingslashit($wp_rewrite->pagination_base."/".$pagenum, 'paged');
2131 2131
 		}
2132 2132
 
2133
-		$result = $base . $request . $query_string;
2133
+		$result = $base.$request.$query_string;
2134 2134
 	}
2135 2135
 
2136 2136
 	/**
@@ -2140,12 +2140,12 @@  discard block
 block discarded – undo
2140 2140
 	 *
2141 2141
 	 * @param string $result The page number link.
2142 2142
 	 */
2143
-	$result = apply_filters( 'get_pagenum_link', $result );
2143
+	$result = apply_filters('get_pagenum_link', $result);
2144 2144
 
2145
-	if ( $escape )
2146
-		return esc_url( $result );
2145
+	if ($escape)
2146
+		return esc_url($result);
2147 2147
 	else
2148
-		return esc_url_raw( $result );
2148
+		return esc_url_raw($result);
2149 2149
 }
2150 2150
 
2151 2151
 /**
@@ -2163,11 +2163,11 @@  discard block
 block discarded – undo
2163 2163
 function get_next_posts_page_link($max_page = 0) {
2164 2164
 	global $paged;
2165 2165
 
2166
-	if ( !is_single() ) {
2167
-		if ( !$paged )
2166
+	if ( ! is_single()) {
2167
+		if ( ! $paged)
2168 2168
 			$paged = 1;
2169 2169
 		$nextpage = intval($paged) + 1;
2170
-		if ( !$max_page || $max_page >= $nextpage )
2170
+		if ( ! $max_page || $max_page >= $nextpage)
2171 2171
 			return get_pagenum_link($nextpage);
2172 2172
 	}
2173 2173
 }
@@ -2181,10 +2181,10 @@  discard block
 block discarded – undo
2181 2181
  * @param bool  $echo     Optional. Whether to echo the link. Default true.
2182 2182
  * @return string|void The link URL for next posts page if `$echo = false`.
2183 2183
  */
2184
-function next_posts( $max_page = 0, $echo = true ) {
2185
-	$output = esc_url( get_next_posts_page_link( $max_page ) );
2184
+function next_posts($max_page = 0, $echo = true) {
2185
+	$output = esc_url(get_next_posts_page_link($max_page));
2186 2186
 
2187
-	if ( $echo )
2187
+	if ($echo)
2188 2188
 		echo $output;
2189 2189
 	else
2190 2190
 		return $output;
@@ -2202,21 +2202,21 @@  discard block
 block discarded – undo
2202 2202
  * @param int    $max_page Optional. Max pages. Default 0.
2203 2203
  * @return string|void HTML-formatted next posts page link.
2204 2204
  */
2205
-function get_next_posts_link( $label = null, $max_page = 0 ) {
2205
+function get_next_posts_link($label = null, $max_page = 0) {
2206 2206
 	global $paged, $wp_query;
2207 2207
 
2208
-	if ( !$max_page )
2208
+	if ( ! $max_page)
2209 2209
 		$max_page = $wp_query->max_num_pages;
2210 2210
 
2211
-	if ( !$paged )
2211
+	if ( ! $paged)
2212 2212
 		$paged = 1;
2213 2213
 
2214 2214
 	$nextpage = intval($paged) + 1;
2215 2215
 
2216
-	if ( null === $label )
2217
-		$label = __( 'Next Page &raquo;' );
2216
+	if (null === $label)
2217
+		$label = __('Next Page &raquo;');
2218 2218
 
2219
-	if ( !is_single() && ( $nextpage <= $max_page ) ) {
2219
+	if ( ! is_single() && ($nextpage <= $max_page)) {
2220 2220
 		/**
2221 2221
 		 * Filters the anchor tag attributes for the next posts page link.
2222 2222
 		 *
@@ -2224,9 +2224,9 @@  discard block
 block discarded – undo
2224 2224
 		 *
2225 2225
 		 * @param string $attributes Attributes for the anchor tag.
2226 2226
 		 */
2227
-		$attr = apply_filters( 'next_posts_link_attributes', '' );
2227
+		$attr = apply_filters('next_posts_link_attributes', '');
2228 2228
 
2229
-		return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) . '</a>';
2229
+		return '<a href="'.next_posts($max_page, false)."\" $attr>".preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label).'</a>';
2230 2230
 	}
2231 2231
 }
2232 2232
 
@@ -2238,8 +2238,8 @@  discard block
 block discarded – undo
2238 2238
  * @param string $label    Content for link text.
2239 2239
  * @param int    $max_page Optional. Max pages. Default 0.
2240 2240
  */
2241
-function next_posts_link( $label = null, $max_page = 0 ) {
2242
-	echo get_next_posts_link( $label, $max_page );
2241
+function next_posts_link($label = null, $max_page = 0) {
2242
+	echo get_next_posts_link($label, $max_page);
2243 2243
 }
2244 2244
 
2245 2245
 /**
@@ -2258,9 +2258,9 @@  discard block
 block discarded – undo
2258 2258
 function get_previous_posts_page_link() {
2259 2259
 	global $paged;
2260 2260
 
2261
-	if ( !is_single() ) {
2261
+	if ( ! is_single()) {
2262 2262
 		$nextpage = intval($paged) - 1;
2263
-		if ( $nextpage < 1 )
2263
+		if ($nextpage < 1)
2264 2264
 			$nextpage = 1;
2265 2265
 		return get_pagenum_link($nextpage);
2266 2266
 	}
@@ -2274,10 +2274,10 @@  discard block
 block discarded – undo
2274 2274
  * @param bool $echo Optional. Whether to echo the link. Default true.
2275 2275
  * @return string|void The previous posts page link if `$echo = false`.
2276 2276
  */
2277
-function previous_posts( $echo = true ) {
2278
-	$output = esc_url( get_previous_posts_page_link() );
2277
+function previous_posts($echo = true) {
2278
+	$output = esc_url(get_previous_posts_page_link());
2279 2279
 
2280
-	if ( $echo )
2280
+	if ($echo)
2281 2281
 		echo $output;
2282 2282
 	else
2283 2283
 		return $output;
@@ -2293,13 +2293,13 @@  discard block
 block discarded – undo
2293 2293
  * @param string $label Optional. Previous page link text.
2294 2294
  * @return string|void HTML-formatted previous page link.
2295 2295
  */
2296
-function get_previous_posts_link( $label = null ) {
2296
+function get_previous_posts_link($label = null) {
2297 2297
 	global $paged;
2298 2298
 
2299
-	if ( null === $label )
2300
-		$label = __( '&laquo; Previous Page' );
2299
+	if (null === $label)
2300
+		$label = __('&laquo; Previous Page');
2301 2301
 
2302
-	if ( !is_single() && $paged > 1 ) {
2302
+	if ( ! is_single() && $paged > 1) {
2303 2303
 		/**
2304 2304
 		 * Filters the anchor tag attributes for the previous posts page link.
2305 2305
 		 *
@@ -2307,8 +2307,8 @@  discard block
 block discarded – undo
2307 2307
 		 *
2308 2308
 		 * @param string $attributes Attributes for the anchor tag.
2309 2309
 		 */
2310
-		$attr = apply_filters( 'previous_posts_link_attributes', '' );
2311
-		return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) .'</a>';
2310
+		$attr = apply_filters('previous_posts_link_attributes', '');
2311
+		return '<a href="'.previous_posts(false)."\" $attr>".preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label).'</a>';
2312 2312
 	}
2313 2313
 }
2314 2314
 
@@ -2319,8 +2319,8 @@  discard block
 block discarded – undo
2319 2319
  *
2320 2320
  * @param string $label Optional. Previous page link text.
2321 2321
  */
2322
-function previous_posts_link( $label = null ) {
2323
-	echo get_previous_posts_link( $label );
2322
+function previous_posts_link($label = null) {
2323
+	echo get_previous_posts_link($label);
2324 2324
 }
2325 2325
 
2326 2326
 /**
@@ -2341,18 +2341,18 @@  discard block
 block discarded – undo
2341 2341
  * }
2342 2342
  * @return string The posts link navigation.
2343 2343
  */
2344
-function get_posts_nav_link( $args = array() ) {
2344
+function get_posts_nav_link($args = array()) {
2345 2345
 	global $wp_query;
2346 2346
 
2347 2347
 	$return = '';
2348 2348
 
2349
-	if ( !is_singular() ) {
2349
+	if ( ! is_singular()) {
2350 2350
 		$defaults = array(
2351 2351
 			'sep' => ' &#8212; ',
2352 2352
 			'prelabel' => __('&laquo; Previous Page'),
2353 2353
 			'nxtlabel' => __('Next Page &raquo;'),
2354 2354
 		);
2355
-		$args = wp_parse_args( $args, $defaults );
2355
+		$args = wp_parse_args($args, $defaults);
2356 2356
 
2357 2357
 		$max_num_pages = $wp_query->max_num_pages;
2358 2358
 		$paged = get_query_var('paged');
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 			$args['sep'] = '';
2363 2363
 		}
2364 2364
 
2365
-		if ( $max_num_pages > 1 ) {
2365
+		if ($max_num_pages > 1) {
2366 2366
 			$return = get_previous_posts_link($args['prelabel']);
2367 2367
 			$return .= preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $args['sep']);
2368 2368
 			$return .= get_next_posts_link($args['nxtlabel']);
@@ -2381,8 +2381,8 @@  discard block
 block discarded – undo
2381 2381
  * @param string $prelabel Optional. Label for previous pages. Default empty.
2382 2382
  * @param string $nxtlabel Optional Label for next pages. Default empty.
2383 2383
  */
2384
-function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
2385
-	$args = array_filter( compact('sep', 'prelabel', 'nxtlabel') );
2384
+function posts_nav_link($sep = '', $prelabel = '', $nxtlabel = '') {
2385
+	$args = array_filter(compact('sep', 'prelabel', 'nxtlabel'));
2386 2386
 	echo get_posts_nav_link($args);
2387 2387
 }
2388 2388
 
@@ -2404,15 +2404,15 @@  discard block
 block discarded – undo
2404 2404
  * }
2405 2405
  * @return string Markup for post links.
2406 2406
  */
2407
-function get_the_post_navigation( $args = array() ) {
2408
-	$args = wp_parse_args( $args, array(
2407
+function get_the_post_navigation($args = array()) {
2408
+	$args = wp_parse_args($args, array(
2409 2409
 		'prev_text'          => '%title',
2410 2410
 		'next_text'          => '%title',
2411 2411
 		'in_same_term'       => false,
2412 2412
 		'excluded_terms'     => '',
2413 2413
 		'taxonomy'           => 'category',
2414
-		'screen_reader_text' => __( 'Post navigation' ),
2415
-	) );
2414
+		'screen_reader_text' => __('Post navigation'),
2415
+	));
2416 2416
 
2417 2417
 	$navigation = '';
2418 2418
 
@@ -2433,8 +2433,8 @@  discard block
 block discarded – undo
2433 2433
 	);
2434 2434
 
2435 2435
 	// Only add markup if there's somewhere to navigate to.
2436
-	if ( $previous || $next ) {
2437
-		$navigation = _navigation_markup( $previous . $next, 'post-navigation', $args['screen_reader_text'] );
2436
+	if ($previous || $next) {
2437
+		$navigation = _navigation_markup($previous.$next, 'post-navigation', $args['screen_reader_text']);
2438 2438
 	}
2439 2439
 
2440 2440
 	return $navigation;
@@ -2448,8 +2448,8 @@  discard block
 block discarded – undo
2448 2448
  * @param array $args Optional. See get_the_post_navigation() for available arguments.
2449 2449
  *                    Default empty array.
2450 2450
  */
2451
-function the_post_navigation( $args = array() ) {
2452
-	echo get_the_post_navigation( $args );
2451
+function the_post_navigation($args = array()) {
2452
+	echo get_the_post_navigation($args);
2453 2453
 }
2454 2454
 
2455 2455
 /**
@@ -2471,29 +2471,29 @@  discard block
 block discarded – undo
2471 2471
  * }
2472 2472
  * @return string Markup for posts links.
2473 2473
  */
2474
-function get_the_posts_navigation( $args = array() ) {
2474
+function get_the_posts_navigation($args = array()) {
2475 2475
 	$navigation = '';
2476 2476
 
2477 2477
 	// Don't print empty markup if there's only one page.
2478
-	if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
2479
-		$args = wp_parse_args( $args, array(
2480
-			'prev_text'          => __( 'Older posts' ),
2481
-			'next_text'          => __( 'Newer posts' ),
2482
-			'screen_reader_text' => __( 'Posts navigation' ),
2483
-		) );
2484
-
2485
-		$next_link = get_previous_posts_link( $args['next_text'] );
2486
-		$prev_link = get_next_posts_link( $args['prev_text'] );
2487
-
2488
-		if ( $prev_link ) {
2489
-			$navigation .= '<div class="nav-previous">' . $prev_link . '</div>';
2478
+	if ($GLOBALS['wp_query']->max_num_pages > 1) {
2479
+		$args = wp_parse_args($args, array(
2480
+			'prev_text'          => __('Older posts'),
2481
+			'next_text'          => __('Newer posts'),
2482
+			'screen_reader_text' => __('Posts navigation'),
2483
+		));
2484
+
2485
+		$next_link = get_previous_posts_link($args['next_text']);
2486
+		$prev_link = get_next_posts_link($args['prev_text']);
2487
+
2488
+		if ($prev_link) {
2489
+			$navigation .= '<div class="nav-previous">'.$prev_link.'</div>';
2490 2490
 		}
2491 2491
 
2492
-		if ( $next_link ) {
2493
-			$navigation .= '<div class="nav-next">' . $next_link . '</div>';
2492
+		if ($next_link) {
2493
+			$navigation .= '<div class="nav-next">'.$next_link.'</div>';
2494 2494
 		}
2495 2495
 
2496
-		$navigation = _navigation_markup( $navigation, 'posts-navigation', $args['screen_reader_text'] );
2496
+		$navigation = _navigation_markup($navigation, 'posts-navigation', $args['screen_reader_text']);
2497 2497
 	}
2498 2498
 
2499 2499
 	return $navigation;
@@ -2507,8 +2507,8 @@  discard block
 block discarded – undo
2507 2507
  * @param array $args Optional. See get_the_posts_navigation() for available arguments.
2508 2508
  *                    Default empty array.
2509 2509
  */
2510
-function the_posts_navigation( $args = array() ) {
2511
-	echo get_the_posts_navigation( $args );
2510
+function the_posts_navigation($args = array()) {
2511
+	echo get_the_posts_navigation($args);
2512 2512
 }
2513 2513
 
2514 2514
 /**
@@ -2524,28 +2524,28 @@  discard block
 block discarded – undo
2524 2524
  * }
2525 2525
  * @return string Markup for pagination links.
2526 2526
  */
2527
-function get_the_posts_pagination( $args = array() ) {
2527
+function get_the_posts_pagination($args = array()) {
2528 2528
 	$navigation = '';
2529 2529
 
2530 2530
 	// Don't print empty markup if there's only one page.
2531
-	if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
2532
-		$args = wp_parse_args( $args, array(
2531
+	if ($GLOBALS['wp_query']->max_num_pages > 1) {
2532
+		$args = wp_parse_args($args, array(
2533 2533
 			'mid_size'           => 1,
2534
-			'prev_text'          => _x( 'Previous', 'previous set of posts' ),
2535
-			'next_text'          => _x( 'Next', 'next set of posts' ),
2536
-			'screen_reader_text' => __( 'Posts navigation' ),
2537
-		) );
2534
+			'prev_text'          => _x('Previous', 'previous set of posts'),
2535
+			'next_text'          => _x('Next', 'next set of posts'),
2536
+			'screen_reader_text' => __('Posts navigation'),
2537
+		));
2538 2538
 
2539 2539
 		// Make sure we get a string back. Plain is the next best thing.
2540
-		if ( isset( $args['type'] ) && 'array' == $args['type'] ) {
2540
+		if (isset($args['type']) && 'array' == $args['type']) {
2541 2541
 			$args['type'] = 'plain';
2542 2542
 		}
2543 2543
 
2544 2544
 		// Set up paginated links.
2545
-		$links = paginate_links( $args );
2545
+		$links = paginate_links($args);
2546 2546
 
2547
-		if ( $links ) {
2548
-			$navigation = _navigation_markup( $links, 'pagination', $args['screen_reader_text'] );
2547
+		if ($links) {
2548
+			$navigation = _navigation_markup($links, 'pagination', $args['screen_reader_text']);
2549 2549
 		}
2550 2550
 	}
2551 2551
 
@@ -2560,8 +2560,8 @@  discard block
 block discarded – undo
2560 2560
  * @param array $args Optional. See get_the_posts_pagination() for available arguments.
2561 2561
  *                    Default empty array.
2562 2562
  */
2563
-function the_posts_pagination( $args = array() ) {
2564
-	echo get_the_posts_pagination( $args );
2563
+function the_posts_pagination($args = array()) {
2564
+	echo get_the_posts_pagination($args);
2565 2565
 }
2566 2566
 
2567 2567
 /**
@@ -2575,9 +2575,9 @@  discard block
 block discarded – undo
2575 2575
  * @param string $screen_reader_text Optional. Screen reader text for nav element. Default: 'Posts navigation'.
2576 2576
  * @return string Navigation template tag.
2577 2577
  */
2578
-function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '' ) {
2579
-	if ( empty( $screen_reader_text ) ) {
2580
-		$screen_reader_text = __( 'Posts navigation' );
2578
+function _navigation_markup($links, $class = 'posts-navigation', $screen_reader_text = '') {
2579
+	if (empty($screen_reader_text)) {
2580
+		$screen_reader_text = __('Posts navigation');
2581 2581
 	}
2582 2582
 
2583 2583
 	$template = '
@@ -2604,9 +2604,9 @@  discard block
 block discarded – undo
2604 2604
 	 * @param string $class    The class passed by the calling function.
2605 2605
 	 * @return string Navigation template.
2606 2606
 	 */
2607
-	$template = apply_filters( 'navigation_markup_template', $template, $class );
2607
+	$template = apply_filters('navigation_markup_template', $template, $class);
2608 2608
 
2609
-	return sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links );
2609
+	return sprintf($template, sanitize_html_class($class), esc_html($screen_reader_text), $links);
2610 2610
 }
2611 2611
 
2612 2612
 /**
@@ -2620,25 +2620,25 @@  discard block
 block discarded – undo
2620 2620
  * @param int $max_page Optional. The maximum number of comment pages. Default 0.
2621 2621
  * @return string The comments page number link URL.
2622 2622
  */
2623
-function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
2623
+function get_comments_pagenum_link($pagenum = 1, $max_page = 0) {
2624 2624
 	global $wp_rewrite;
2625 2625
 
2626 2626
 	$pagenum = (int) $pagenum;
2627 2627
 
2628 2628
 	$result = get_permalink();
2629 2629
 
2630
-	if ( 'newest' == get_option('default_comments_page') ) {
2631
-		if ( $pagenum != $max_page ) {
2632
-			if ( $wp_rewrite->using_permalinks() )
2633
-				$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2630
+	if ('newest' == get_option('default_comments_page')) {
2631
+		if ($pagenum != $max_page) {
2632
+			if ($wp_rewrite->using_permalinks())
2633
+				$result = user_trailingslashit(trailingslashit($result).$wp_rewrite->comments_pagination_base.'-'.$pagenum, 'commentpaged');
2634 2634
 			else
2635
-				$result = add_query_arg( 'cpage', $pagenum, $result );
2635
+				$result = add_query_arg('cpage', $pagenum, $result);
2636 2636
 		}
2637
-	} elseif ( $pagenum > 1 ) {
2638
-		if ( $wp_rewrite->using_permalinks() )
2639
-			$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2637
+	} elseif ($pagenum > 1) {
2638
+		if ($wp_rewrite->using_permalinks())
2639
+			$result = user_trailingslashit(trailingslashit($result).$wp_rewrite->comments_pagination_base.'-'.$pagenum, 'commentpaged');
2640 2640
 		else
2641
-			$result = add_query_arg( 'cpage', $pagenum, $result );
2641
+			$result = add_query_arg('cpage', $pagenum, $result);
2642 2642
 	}
2643 2643
 
2644 2644
 	$result .= '#comments';
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 	 *
2651 2651
 	 * @param string $result The comments page number link.
2652 2652
 	 */
2653
-	return apply_filters( 'get_comments_pagenum_link', $result );
2653
+	return apply_filters('get_comments_pagenum_link', $result);
2654 2654
 }
2655 2655
 
2656 2656
 /**
@@ -2664,30 +2664,30 @@  discard block
 block discarded – undo
2664 2664
  * @param int    $max_page Optional. Max page. Default 0.
2665 2665
  * @return string|void HTML-formatted link for the next page of comments.
2666 2666
  */
2667
-function get_next_comments_link( $label = '', $max_page = 0 ) {
2667
+function get_next_comments_link($label = '', $max_page = 0) {
2668 2668
 	global $wp_query;
2669 2669
 
2670
-	if ( ! is_singular() )
2670
+	if ( ! is_singular())
2671 2671
 		return;
2672 2672
 
2673 2673
 	$page = get_query_var('cpage');
2674 2674
 
2675
-	if ( ! $page ) {
2675
+	if ( ! $page) {
2676 2676
 		$page = 1;
2677 2677
 	}
2678 2678
 
2679 2679
 	$nextpage = intval($page) + 1;
2680 2680
 
2681
-	if ( empty($max_page) )
2681
+	if (empty($max_page))
2682 2682
 		$max_page = $wp_query->max_num_comment_pages;
2683 2683
 
2684
-	if ( empty($max_page) )
2684
+	if (empty($max_page))
2685 2685
 		$max_page = get_comment_pages_count();
2686 2686
 
2687
-	if ( $nextpage > $max_page )
2687
+	if ($nextpage > $max_page)
2688 2688
 		return;
2689 2689
 
2690
-	if ( empty($label) )
2690
+	if (empty($label))
2691 2691
 		$label = __('Newer Comments &raquo;');
2692 2692
 
2693 2693
 	/**
@@ -2697,7 +2697,7 @@  discard block
 block discarded – undo
2697 2697
 	 *
2698 2698
 	 * @param string $attributes Attributes for the anchor tag.
2699 2699
 	 */
2700
-	return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
2700
+	return '<a href="'.esc_url(get_comments_pagenum_link($nextpage, $max_page)).'" '.apply_filters('next_comments_link_attributes', '').'>'.preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label).'</a>';
2701 2701
 }
2702 2702
 
2703 2703
 /**
@@ -2708,8 +2708,8 @@  discard block
 block discarded – undo
2708 2708
  * @param string $label    Optional. Label for link text. Default empty.
2709 2709
  * @param int    $max_page Optional. Max page. Default 0.
2710 2710
  */
2711
-function next_comments_link( $label = '', $max_page = 0 ) {
2712
-	echo get_next_comments_link( $label, $max_page );
2711
+function next_comments_link($label = '', $max_page = 0) {
2712
+	echo get_next_comments_link($label, $max_page);
2713 2713
 }
2714 2714
 
2715 2715
 /**
@@ -2720,18 +2720,18 @@  discard block
 block discarded – undo
2720 2720
  * @param string $label Optional. Label for comments link text. Default empty.
2721 2721
  * @return string|void HTML-formatted link for the previous page of comments.
2722 2722
  */
2723
-function get_previous_comments_link( $label = '' ) {
2724
-	if ( ! is_singular() )
2723
+function get_previous_comments_link($label = '') {
2724
+	if ( ! is_singular())
2725 2725
 		return;
2726 2726
 
2727 2727
 	$page = get_query_var('cpage');
2728 2728
 
2729
-	if ( intval($page) <= 1 )
2729
+	if (intval($page) <= 1)
2730 2730
 		return;
2731 2731
 
2732 2732
 	$prevpage = intval($page) - 1;
2733 2733
 
2734
-	if ( empty($label) )
2734
+	if (empty($label))
2735 2735
 		$label = __('&laquo; Older Comments');
2736 2736
 
2737 2737
 	/**
@@ -2741,7 +2741,7 @@  discard block
 block discarded – undo
2741 2741
 	 *
2742 2742
 	 * @param string $attributes Attributes for the anchor tag.
2743 2743
 	 */
2744
-	return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .'</a>';
2744
+	return '<a href="'.esc_url(get_comments_pagenum_link($prevpage)).'" '.apply_filters('previous_comments_link_attributes', '').'>'.preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label).'</a>';
2745 2745
 }
2746 2746
 
2747 2747
 /**
@@ -2751,8 +2751,8 @@  discard block
 block discarded – undo
2751 2751
  *
2752 2752
  * @param string $label Optional. Label for comments link text. Default empty.
2753 2753
  */
2754
-function previous_comments_link( $label = '' ) {
2755
-	echo get_previous_comments_link( $label );
2754
+function previous_comments_link($label = '') {
2755
+	echo get_previous_comments_link($label);
2756 2756
 }
2757 2757
 
2758 2758
 /**
@@ -2766,31 +2766,31 @@  discard block
 block discarded – undo
2766 2766
  * @param string|array $args Optional args. See paginate_links(). Default empty array.
2767 2767
  * @return string|void Markup for pagination links.
2768 2768
  */
2769
-function paginate_comments_links( $args = array() ) {
2769
+function paginate_comments_links($args = array()) {
2770 2770
 	global $wp_rewrite;
2771 2771
 
2772
-	if ( ! is_singular() )
2772
+	if ( ! is_singular())
2773 2773
 		return;
2774 2774
 
2775 2775
 	$page = get_query_var('cpage');
2776
-	if ( !$page )
2776
+	if ( ! $page)
2777 2777
 		$page = 1;
2778 2778
 	$max_page = get_comment_pages_count();
2779 2779
 	$defaults = array(
2780
-		'base' => add_query_arg( 'cpage', '%#%' ),
2780
+		'base' => add_query_arg('cpage', '%#%'),
2781 2781
 		'format' => '',
2782 2782
 		'total' => $max_page,
2783 2783
 		'current' => $page,
2784 2784
 		'echo' => true,
2785 2785
 		'add_fragment' => '#comments'
2786 2786
 	);
2787
-	if ( $wp_rewrite->using_permalinks() )
2788
-		$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
2787
+	if ($wp_rewrite->using_permalinks())
2788
+		$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()).$wp_rewrite->comments_pagination_base.'-%#%', 'commentpaged');
2789 2789
 
2790
-	$args = wp_parse_args( $args, $defaults );
2791
-	$page_links = paginate_links( $args );
2790
+	$args = wp_parse_args($args, $defaults);
2791
+	$page_links = paginate_links($args);
2792 2792
 
2793
-	if ( $args['echo'] )
2793
+	if ($args['echo'])
2794 2794
 		echo $page_links;
2795 2795
 	else
2796 2796
 		return $page_links;
@@ -2812,29 +2812,29 @@  discard block
 block discarded – undo
2812 2812
  * }
2813 2813
  * @return string Markup for comments links.
2814 2814
  */
2815
-function get_the_comments_navigation( $args = array() ) {
2815
+function get_the_comments_navigation($args = array()) {
2816 2816
 	$navigation = '';
2817 2817
 
2818 2818
 	// Are there comments to navigate through?
2819
-	if ( get_comment_pages_count() > 1 ) {
2820
-		$args = wp_parse_args( $args, array(
2821
-			'prev_text'          => __( 'Older comments' ),
2822
-			'next_text'          => __( 'Newer comments' ),
2823
-			'screen_reader_text' => __( 'Comments navigation' ),
2824
-		) );
2825
-
2826
-		$prev_link = get_previous_comments_link( $args['prev_text'] );
2827
-		$next_link = get_next_comments_link( $args['next_text'] );
2828
-
2829
-		if ( $prev_link ) {
2830
-			$navigation .= '<div class="nav-previous">' . $prev_link . '</div>';
2819
+	if (get_comment_pages_count() > 1) {
2820
+		$args = wp_parse_args($args, array(
2821
+			'prev_text'          => __('Older comments'),
2822
+			'next_text'          => __('Newer comments'),
2823
+			'screen_reader_text' => __('Comments navigation'),
2824
+		));
2825
+
2826
+		$prev_link = get_previous_comments_link($args['prev_text']);
2827
+		$next_link = get_next_comments_link($args['next_text']);
2828
+
2829
+		if ($prev_link) {
2830
+			$navigation .= '<div class="nav-previous">'.$prev_link.'</div>';
2831 2831
 		}
2832 2832
 
2833
-		if ( $next_link ) {
2834
-			$navigation .= '<div class="nav-next">' . $next_link . '</div>';
2833
+		if ($next_link) {
2834
+			$navigation .= '<div class="nav-next">'.$next_link.'</div>';
2835 2835
 		}
2836 2836
 
2837
-		$navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'] );
2837
+		$navigation = _navigation_markup($navigation, 'comment-navigation', $args['screen_reader_text']);
2838 2838
 	}
2839 2839
 
2840 2840
 	return $navigation;
@@ -2847,8 +2847,8 @@  discard block
 block discarded – undo
2847 2847
  *
2848 2848
  * @param array $args See get_the_comments_navigation() for available arguments. Default empty array.
2849 2849
  */
2850
-function the_comments_navigation( $args = array() ) {
2851
-	echo get_the_comments_navigation( $args );
2850
+function the_comments_navigation($args = array()) {
2851
+	echo get_the_comments_navigation($args);
2852 2852
 }
2853 2853
 
2854 2854
 /**
@@ -2865,20 +2865,20 @@  discard block
 block discarded – undo
2865 2865
  * }
2866 2866
  * @return string Markup for pagination links.
2867 2867
  */
2868
-function get_the_comments_pagination( $args = array() ) {
2868
+function get_the_comments_pagination($args = array()) {
2869 2869
 	$navigation = '';
2870
-	$args       = wp_parse_args( $args, array(
2871
-		'screen_reader_text' => __( 'Comments navigation' ),
2872
-	) );
2870
+	$args       = wp_parse_args($args, array(
2871
+		'screen_reader_text' => __('Comments navigation'),
2872
+	));
2873 2873
 	$args['echo'] = false;
2874 2874
 
2875 2875
 	// Make sure we get plain links, so we get a string we can work with.
2876 2876
 	$args['type'] = 'plain';
2877 2877
 
2878
-	$links = paginate_comments_links( $args );
2878
+	$links = paginate_comments_links($args);
2879 2879
 
2880
-	if ( $links ) {
2881
-		$navigation = _navigation_markup( $links, 'comments-pagination', $args['screen_reader_text'] );
2880
+	if ($links) {
2881
+		$navigation = _navigation_markup($links, 'comments-pagination', $args['screen_reader_text']);
2882 2882
 	}
2883 2883
 
2884 2884
 	return $navigation;
@@ -2891,8 +2891,8 @@  discard block
 block discarded – undo
2891 2891
  *
2892 2892
  * @param array $args See get_the_comments_pagination() for available arguments. Default empty array.
2893 2893
  */
2894
-function the_comments_pagination( $args = array() ) {
2895
-	echo get_the_comments_pagination( $args );
2894
+function the_comments_pagination($args = array()) {
2895
+	echo get_the_comments_pagination($args);
2896 2896
 }
2897 2897
 
2898 2898
 /**
@@ -2905,11 +2905,11 @@  discard block
 block discarded – undo
2905 2905
 function get_shortcut_link() {
2906 2906
 	global $is_IE;
2907 2907
 
2908
-	include_once( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
2908
+	include_once(ABSPATH.'wp-admin/includes/class-wp-press-this.php');
2909 2909
 
2910 2910
 	$link = '';
2911 2911
 
2912
-	if ( $is_IE ) {
2912
+	if ($is_IE) {
2913 2913
 		/*
2914 2914
 		 * Return the old/shorter bookmarklet code for MSIE 8 and lower,
2915 2915
 		 * since they only support a max length of ~2000 characters for
@@ -2919,27 +2919,27 @@  discard block
 block discarded – undo
2919 2919
 		 */
2920 2920
 		$ua = $_SERVER['HTTP_USER_AGENT'];
2921 2921
 
2922
-		if ( ! empty( $ua ) && preg_match( '/\bMSIE (\d)/', $ua, $matches ) && (int) $matches[1] <= 8 ) {
2923
-			$url = wp_json_encode( admin_url( 'press-this.php' ) );
2922
+		if ( ! empty($ua) && preg_match('/\bMSIE (\d)/', $ua, $matches) && (int) $matches[1] <= 8) {
2923
+			$url = wp_json_encode(admin_url('press-this.php'));
2924 2924
 
2925
-			$link = 'javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,' .
2926
-				's=(e?e():(k)?k():(x?x.createRange().text:0)),f=' . $url . ',l=d.location,e=encodeURIComponent,' .
2927
-				'u=f+"?u="+e(l.href)+"&t="+e(d.title)+"&s="+e(s)+"&v=' . WP_Press_This::VERSION . '";' .
2928
-				'a=function(){if(!w.open(u,"t","toolbar=0,resizable=1,scrollbars=1,status=1,width=600,height=700"))l.href=u;};' .
2925
+			$link = 'javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,'.
2926
+				's=(e?e():(k)?k():(x?x.createRange().text:0)),f='.$url.',l=d.location,e=encodeURIComponent,'.
2927
+				'u=f+"?u="+e(l.href)+"&t="+e(d.title)+"&s="+e(s)+"&v='.WP_Press_This::VERSION.'";'.
2928
+				'a=function(){if(!w.open(u,"t","toolbar=0,resizable=1,scrollbars=1,status=1,width=600,height=700"))l.href=u;};'.
2929 2929
 				'if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();void(0)';
2930 2930
 		}
2931 2931
 	}
2932 2932
 
2933
-	if ( empty( $link ) ) {
2934
-		$src = @file_get_contents( ABSPATH . 'wp-admin/js/bookmarklet.min.js' );
2933
+	if (empty($link)) {
2934
+		$src = @file_get_contents(ABSPATH.'wp-admin/js/bookmarklet.min.js');
2935 2935
 
2936
-		if ( $src ) {
2937
-			$url = wp_json_encode( admin_url( 'press-this.php' ) . '?v=' . WP_Press_This::VERSION );
2938
-			$link = 'javascript:' . str_replace( 'window.pt_url', $url, $src );
2936
+		if ($src) {
2937
+			$url = wp_json_encode(admin_url('press-this.php').'?v='.WP_Press_This::VERSION);
2938
+			$link = 'javascript:'.str_replace('window.pt_url', $url, $src);
2939 2939
 		}
2940 2940
 	}
2941 2941
 
2942
-	$link = str_replace( array( "\r", "\n", "\t" ),  '', $link );
2942
+	$link = str_replace(array("\r", "\n", "\t"), '', $link);
2943 2943
 
2944 2944
 	/**
2945 2945
 	 * Filters the Press This bookmarklet link.
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
 	 *
2949 2949
 	 * @param string $link The Press This bookmarklet link.
2950 2950
 	 */
2951
-	return apply_filters( 'shortcut_link', $link );
2951
+	return apply_filters('shortcut_link', $link);
2952 2952
 }
2953 2953
 
2954 2954
 /**
@@ -2965,8 +2965,8 @@  discard block
 block discarded – undo
2965 2965
  *                             'http', 'https', 'relative', 'rest', or null. Default null.
2966 2966
  * @return string Home URL link with optional path appended.
2967 2967
  */
2968
-function home_url( $path = '', $scheme = null ) {
2969
-	return get_home_url( null, $path, $scheme );
2968
+function home_url($path = '', $scheme = null) {
2969
+	return get_home_url(null, $path, $scheme);
2970 2970
 }
2971 2971
 
2972 2972
 /**
@@ -2986,30 +2986,30 @@  discard block
 block discarded – undo
2986 2986
  *                              'http', 'https', 'relative', 'rest', or null. Default null.
2987 2987
  * @return string Home URL link with optional path appended.
2988 2988
  */
2989
-function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
2989
+function get_home_url($blog_id = null, $path = '', $scheme = null) {
2990 2990
 	global $pagenow;
2991 2991
 
2992 2992
 	$orig_scheme = $scheme;
2993 2993
 
2994
-	if ( empty( $blog_id ) || !is_multisite() ) {
2995
-		$url = get_option( 'home' );
2994
+	if (empty($blog_id) || ! is_multisite()) {
2995
+		$url = get_option('home');
2996 2996
 	} else {
2997
-		switch_to_blog( $blog_id );
2998
-		$url = get_option( 'home' );
2997
+		switch_to_blog($blog_id);
2998
+		$url = get_option('home');
2999 2999
 		restore_current_blog();
3000 3000
 	}
3001 3001
 
3002
-	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
3003
-		if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow )
3002
+	if ( ! in_array($scheme, array('http', 'https', 'relative'))) {
3003
+		if (is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow)
3004 3004
 			$scheme = 'https';
3005 3005
 		else
3006
-			$scheme = parse_url( $url, PHP_URL_SCHEME );
3006
+			$scheme = parse_url($url, PHP_URL_SCHEME);
3007 3007
 	}
3008 3008
 
3009
-	$url = set_url_scheme( $url, $scheme );
3009
+	$url = set_url_scheme($url, $scheme);
3010 3010
 
3011
-	if ( $path && is_string( $path ) )
3012
-		$url .= '/' . ltrim( $path, '/' );
3011
+	if ($path && is_string($path))
3012
+		$url .= '/'.ltrim($path, '/');
3013 3013
 
3014 3014
 	/**
3015 3015
 	 * Filters the home URL.
@@ -3022,7 +3022,7 @@  discard block
 block discarded – undo
3022 3022
 	 *                                 'relative', 'rest', or null.
3023 3023
 	 * @param int|null    $blog_id     Site ID, or null for the current site.
3024 3024
 	 */
3025
-	return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );
3025
+	return apply_filters('home_url', $url, $path, $orig_scheme, $blog_id);
3026 3026
 }
3027 3027
 
3028 3028
 /**
@@ -3039,8 +3039,8 @@  discard block
 block discarded – undo
3039 3039
  * @param string $scheme Optional. Scheme to give the site URL context. See set_url_scheme().
3040 3040
  * @return string Site URL link with optional path appended.
3041 3041
  */
3042
-function site_url( $path = '', $scheme = null ) {
3043
-	return get_site_url( null, $path, $scheme );
3042
+function site_url($path = '', $scheme = null) {
3043
+	return get_site_url(null, $path, $scheme);
3044 3044
 }
3045 3045
 
3046 3046
 /**
@@ -3060,19 +3060,19 @@  discard block
 block discarded – undo
3060 3060
  *                        'relative'. Default null.
3061 3061
  * @return string Site URL link with optional path appended.
3062 3062
  */
3063
-function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
3064
-	if ( empty( $blog_id ) || !is_multisite() ) {
3065
-		$url = get_option( 'siteurl' );
3063
+function get_site_url($blog_id = null, $path = '', $scheme = null) {
3064
+	if (empty($blog_id) || ! is_multisite()) {
3065
+		$url = get_option('siteurl');
3066 3066
 	} else {
3067
-		switch_to_blog( $blog_id );
3068
-		$url = get_option( 'siteurl' );
3067
+		switch_to_blog($blog_id);
3068
+		$url = get_option('siteurl');
3069 3069
 		restore_current_blog();
3070 3070
 	}
3071 3071
 
3072
-	$url = set_url_scheme( $url, $scheme );
3072
+	$url = set_url_scheme($url, $scheme);
3073 3073
 
3074
-	if ( $path && is_string( $path ) )
3075
-		$url .= '/' . ltrim( $path, '/' );
3074
+	if ($path && is_string($path))
3075
+		$url .= '/'.ltrim($path, '/');
3076 3076
 
3077 3077
 	/**
3078 3078
 	 * Filters the site URL.
@@ -3085,7 +3085,7 @@  discard block
 block discarded – undo
3085 3085
 	 *                             'login_post', 'admin', 'relative' or null.
3086 3086
 	 * @param int|null    $blog_id Site ID, or null for the current site.
3087 3087
 	 */
3088
-	return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
3088
+	return apply_filters('site_url', $url, $path, $scheme, $blog_id);
3089 3089
 }
3090 3090
 
3091 3091
 /**
@@ -3098,8 +3098,8 @@  discard block
 block discarded – undo
3098 3098
  *                       'http' or 'https' can be passed to force those schemes.
3099 3099
  * @return string Admin URL link with optional path appended.
3100 3100
  */
3101
-function admin_url( $path = '', $scheme = 'admin' ) {
3102
-	return get_admin_url( null, $path, $scheme );
3101
+function admin_url($path = '', $scheme = 'admin') {
3102
+	return get_admin_url(null, $path, $scheme);
3103 3103
 }
3104 3104
 
3105 3105
 /**
@@ -3114,11 +3114,11 @@  discard block
 block discarded – undo
3114 3114
  *                        force_ssl_admin() and is_ssl().
3115 3115
  * @return string Admin URL link with optional path appended.
3116 3116
  */
3117
-function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
3117
+function get_admin_url($blog_id = null, $path = '', $scheme = 'admin') {
3118 3118
 	$url = get_site_url($blog_id, 'wp-admin/', $scheme);
3119 3119
 
3120
-	if ( $path && is_string( $path ) )
3121
-		$url .= ltrim( $path, '/' );
3120
+	if ($path && is_string($path))
3121
+		$url .= ltrim($path, '/');
3122 3122
 
3123 3123
 	/**
3124 3124
 	 * Filters the admin area URL.
@@ -3129,7 +3129,7 @@  discard block
 block discarded – undo
3129 3129
 	 * @param string   $path    Path relative to the admin area URL. Blank string if no path is specified.
3130 3130
 	 * @param int|null $blog_id Site ID, or null for the current site.
3131 3131
 	 */
3132
-	return apply_filters( 'admin_url', $url, $path, $blog_id );
3132
+	return apply_filters('admin_url', $url, $path, $blog_id);
3133 3133
 }
3134 3134
 
3135 3135
 /**
@@ -3142,10 +3142,10 @@  discard block
 block discarded – undo
3142 3142
  *                       'http', 'https', or 'relative'. Default null.
3143 3143
  * @return string Includes URL link with optional path appended.
3144 3144
  */
3145
-function includes_url( $path = '', $scheme = null ) {
3146
-	$url = site_url( '/' . WPINC . '/', $scheme );
3145
+function includes_url($path = '', $scheme = null) {
3146
+	$url = site_url('/'.WPINC.'/', $scheme);
3147 3147
 
3148
-	if ( $path && is_string( $path ) )
3148
+	if ($path && is_string($path))
3149 3149
 		$url .= ltrim($path, '/');
3150 3150
 
3151 3151
 	/**
@@ -3157,7 +3157,7 @@  discard block
 block discarded – undo
3157 3157
 	 * @param string $path Path relative to the URL to the wp-includes directory. Blank string
3158 3158
 	 *                     if no path is specified.
3159 3159
 	 */
3160
-	return apply_filters( 'includes_url', $url, $path );
3160
+	return apply_filters('includes_url', $url, $path);
3161 3161
 }
3162 3162
 
3163 3163
 /**
@@ -3168,11 +3168,11 @@  discard block
 block discarded – undo
3168 3168
  * @param string $path Optional. Path relative to the content URL. Default empty.
3169 3169
  * @return string Content URL link with optional path appended.
3170 3170
  */
3171
-function content_url( $path = '' ) {
3172
-	$url = set_url_scheme( WP_CONTENT_URL );
3171
+function content_url($path = '') {
3172
+	$url = set_url_scheme(WP_CONTENT_URL);
3173 3173
 
3174
-	if ( $path && is_string( $path ) )
3175
-		$url .= '/' . ltrim($path, '/');
3174
+	if ($path && is_string($path))
3175
+		$url .= '/'.ltrim($path, '/');
3176 3176
 
3177 3177
 	/**
3178 3178
 	 * Filters the URL to the content directory.
@@ -3183,7 +3183,7 @@  discard block
 block discarded – undo
3183 3183
 	 * @param string $path Path relative to the URL to the content directory. Blank string
3184 3184
 	 *                     if no path is specified.
3185 3185
 	 */
3186
-	return apply_filters( 'content_url', $url, $path);
3186
+	return apply_filters('content_url', $url, $path);
3187 3187
 }
3188 3188
 
3189 3189
 /**
@@ -3200,28 +3200,28 @@  discard block
 block discarded – undo
3200 3200
  *                        Typically this is done by passing `__FILE__` as the argument.
3201 3201
  * @return string Plugins URL link with optional paths appended.
3202 3202
  */
3203
-function plugins_url( $path = '', $plugin = '' ) {
3203
+function plugins_url($path = '', $plugin = '') {
3204 3204
 
3205
-	$path = wp_normalize_path( $path );
3206
-	$plugin = wp_normalize_path( $plugin );
3207
-	$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
3205
+	$path = wp_normalize_path($path);
3206
+	$plugin = wp_normalize_path($plugin);
3207
+	$mu_plugin_dir = wp_normalize_path(WPMU_PLUGIN_DIR);
3208 3208
 
3209
-	if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) )
3209
+	if ( ! empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir))
3210 3210
 		$url = WPMU_PLUGIN_URL;
3211 3211
 	else
3212 3212
 		$url = WP_PLUGIN_URL;
3213 3213
 
3214 3214
 
3215
-	$url = set_url_scheme( $url );
3215
+	$url = set_url_scheme($url);
3216 3216
 
3217
-	if ( !empty($plugin) && is_string($plugin) ) {
3217
+	if ( ! empty($plugin) && is_string($plugin)) {
3218 3218
 		$folder = dirname(plugin_basename($plugin));
3219
-		if ( '.' != $folder )
3220
-			$url .= '/' . ltrim($folder, '/');
3219
+		if ('.' != $folder)
3220
+			$url .= '/'.ltrim($folder, '/');
3221 3221
 	}
3222 3222
 
3223
-	if ( $path && is_string( $path ) )
3224
-		$url .= '/' . ltrim($path, '/');
3223
+	if ($path && is_string($path))
3224
+		$url .= '/'.ltrim($path, '/');
3225 3225
 
3226 3226
 	/**
3227 3227
 	 * Filters the URL to the plugins directory.
@@ -3234,7 +3234,7 @@  discard block
 block discarded – undo
3234 3234
 	 * @param string $plugin The plugin file path to be relative to. Blank string if no plugin
3235 3235
 	 *                       is specified.
3236 3236
 	 */
3237
-	return apply_filters( 'plugins_url', $url, $path, $plugin );
3237
+	return apply_filters('plugins_url', $url, $path, $plugin);
3238 3238
 }
3239 3239
 
3240 3240
 /**
@@ -3253,19 +3253,19 @@  discard block
 block discarded – undo
3253 3253
  *                       'http', 'https', or 'relative'. Default null.
3254 3254
  * @return string Site URL link with optional path appended.
3255 3255
  */
3256
-function network_site_url( $path = '', $scheme = null ) {
3257
-	if ( ! is_multisite() )
3256
+function network_site_url($path = '', $scheme = null) {
3257
+	if ( ! is_multisite())
3258 3258
 		return site_url($path, $scheme);
3259 3259
 
3260 3260
 	$current_network = get_network();
3261 3261
 
3262
-	if ( 'relative' == $scheme )
3262
+	if ('relative' == $scheme)
3263 3263
 		$url = $current_network->path;
3264 3264
 	else
3265
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3265
+		$url = set_url_scheme('http://'.$current_network->domain.$current_network->path, $scheme);
3266 3266
 
3267
-	if ( $path && is_string( $path ) )
3268
-		$url .= ltrim( $path, '/' );
3267
+	if ($path && is_string($path))
3268
+		$url .= ltrim($path, '/');
3269 3269
 
3270 3270
 	/**
3271 3271
 	 * Filters the network site URL.
@@ -3278,7 +3278,7 @@  discard block
 block discarded – undo
3278 3278
 	 * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',
3279 3279
 	 *                            'relative' or null.
3280 3280
 	 */
3281
-	return apply_filters( 'network_site_url', $url, $path, $scheme );
3281
+	return apply_filters('network_site_url', $url, $path, $scheme);
3282 3282
 }
3283 3283
 
3284 3284
 /**
@@ -3295,23 +3295,23 @@  discard block
 block discarded – undo
3295 3295
  *                        'http', 'https', or 'relative'. Default null.
3296 3296
  * @return string Home URL link with optional path appended.
3297 3297
  */
3298
-function network_home_url( $path = '', $scheme = null ) {
3299
-	if ( ! is_multisite() )
3298
+function network_home_url($path = '', $scheme = null) {
3299
+	if ( ! is_multisite())
3300 3300
 		return home_url($path, $scheme);
3301 3301
 
3302 3302
 	$current_network = get_network();
3303 3303
 	$orig_scheme = $scheme;
3304 3304
 
3305
-	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
3305
+	if ( ! in_array($scheme, array('http', 'https', 'relative')))
3306 3306
 		$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
3307 3307
 
3308
-	if ( 'relative' == $scheme )
3308
+	if ('relative' == $scheme)
3309 3309
 		$url = $current_network->path;
3310 3310
 	else
3311
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3311
+		$url = set_url_scheme('http://'.$current_network->domain.$current_network->path, $scheme);
3312 3312
 
3313
-	if ( $path && is_string( $path ) )
3314
-		$url .= ltrim( $path, '/' );
3313
+	if ($path && is_string($path))
3314
+		$url .= ltrim($path, '/');
3315 3315
 
3316 3316
 	/**
3317 3317
 	 * Filters the network home URL.
@@ -3324,7 +3324,7 @@  discard block
 block discarded – undo
3324 3324
 	 * @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https',
3325 3325
 	 *                                 'relative' or null.
3326 3326
 	 */
3327
-	return apply_filters( 'network_home_url', $url, $path, $orig_scheme);
3327
+	return apply_filters('network_home_url', $url, $path, $orig_scheme);
3328 3328
 }
3329 3329
 
3330 3330
 /**
@@ -3337,13 +3337,13 @@  discard block
 block discarded – undo
3337 3337
  *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
3338 3338
  * @return string Admin URL link with optional path appended.
3339 3339
  */
3340
-function network_admin_url( $path = '', $scheme = 'admin' ) {
3341
-	if ( ! is_multisite() )
3342
-		return admin_url( $path, $scheme );
3340
+function network_admin_url($path = '', $scheme = 'admin') {
3341
+	if ( ! is_multisite())
3342
+		return admin_url($path, $scheme);
3343 3343
 
3344 3344
 	$url = network_site_url('wp-admin/network/', $scheme);
3345 3345
 
3346
-	if ( $path && is_string( $path ) )
3346
+	if ($path && is_string($path))
3347 3347
 		$url .= ltrim($path, '/');
3348 3348
 
3349 3349
 	/**
@@ -3355,7 +3355,7 @@  discard block
 block discarded – undo
3355 3355
 	 * @param string $path Path relative to the network admin URL. Blank string if
3356 3356
 	 *                     no path is specified.
3357 3357
 	 */
3358
-	return apply_filters( 'network_admin_url', $url, $path );
3358
+	return apply_filters('network_admin_url', $url, $path);
3359 3359
 }
3360 3360
 
3361 3361
 /**
@@ -3368,10 +3368,10 @@  discard block
 block discarded – undo
3368 3368
  *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
3369 3369
  * @return string Admin URL link with optional path appended.
3370 3370
  */
3371
-function user_admin_url( $path = '', $scheme = 'admin' ) {
3371
+function user_admin_url($path = '', $scheme = 'admin') {
3372 3372
 	$url = network_site_url('wp-admin/user/', $scheme);
3373 3373
 
3374
-	if ( $path && is_string( $path ) )
3374
+	if ($path && is_string($path))
3375 3375
 		$url .= ltrim($path, '/');
3376 3376
 
3377 3377
 	/**
@@ -3383,7 +3383,7 @@  discard block
 block discarded – undo
3383 3383
 	 * @param string $path Path relative to the URL. Blank string if
3384 3384
 	 *                     no path is specified.
3385 3385
 	 */
3386
-	return apply_filters( 'user_admin_url', $url, $path );
3386
+	return apply_filters('user_admin_url', $url, $path);
3387 3387
 }
3388 3388
 
3389 3389
 /**
@@ -3396,10 +3396,10 @@  discard block
 block discarded – undo
3396 3396
  *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.
3397 3397
  * @return string Admin URL link with optional path appended.
3398 3398
  */
3399
-function self_admin_url( $path = '', $scheme = 'admin' ) {
3400
-	if ( is_network_admin() )
3399
+function self_admin_url($path = '', $scheme = 'admin') {
3400
+	if (is_network_admin())
3401 3401
 		return network_admin_url($path, $scheme);
3402
-	elseif ( is_user_admin() )
3402
+	elseif (is_user_admin())
3403 3403
 		return user_admin_url($path, $scheme);
3404 3404
 	else
3405 3405
 		return admin_url($path, $scheme);
@@ -3416,27 +3416,27 @@  discard block
 block discarded – undo
3416 3416
  *                            'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null.
3417 3417
  * @return string $url URL with chosen scheme.
3418 3418
  */
3419
-function set_url_scheme( $url, $scheme = null ) {
3419
+function set_url_scheme($url, $scheme = null) {
3420 3420
 	$orig_scheme = $scheme;
3421 3421
 
3422
-	if ( ! $scheme ) {
3422
+	if ( ! $scheme) {
3423 3423
 		$scheme = is_ssl() ? 'https' : 'http';
3424
-	} elseif ( $scheme === 'admin' || $scheme === 'login' || $scheme === 'login_post' || $scheme === 'rpc' ) {
3424
+	} elseif ($scheme === 'admin' || $scheme === 'login' || $scheme === 'login_post' || $scheme === 'rpc') {
3425 3425
 		$scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';
3426
-	} elseif ( $scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative' ) {
3426
+	} elseif ($scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative') {
3427 3427
 		$scheme = is_ssl() ? 'https' : 'http';
3428 3428
 	}
3429 3429
 
3430
-	$url = trim( $url );
3431
-	if ( substr( $url, 0, 2 ) === '//' )
3432
-		$url = 'http:' . $url;
3430
+	$url = trim($url);
3431
+	if (substr($url, 0, 2) === '//')
3432
+		$url = 'http:'.$url;
3433 3433
 
3434
-	if ( 'relative' == $scheme ) {
3435
-		$url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) );
3436
-		if ( $url !== '' && $url[0] === '/' )
3437
-			$url = '/' . ltrim($url , "/ \t\n\r\0\x0B" );
3434
+	if ('relative' == $scheme) {
3435
+		$url = ltrim(preg_replace('#^\w+://[^/]*#', '', $url));
3436
+		if ($url !== '' && $url[0] === '/')
3437
+			$url = '/'.ltrim($url, "/ \t\n\r\0\x0B");
3438 3438
 	} else {
3439
-		$url = preg_replace( '#^\w+://#', $scheme . '://', $url );
3439
+		$url = preg_replace('#^\w+://#', $scheme.'://', $url);
3440 3440
 	}
3441 3441
 
3442 3442
 	/**
@@ -3449,7 +3449,7 @@  discard block
 block discarded – undo
3449 3449
 	 * @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',
3450 3450
 	 *                                 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.
3451 3451
 	 */
3452
-	return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );
3452
+	return apply_filters('set_url_scheme', $url, $scheme, $orig_scheme);
3453 3453
 }
3454 3454
 
3455 3455
 /**
@@ -3468,24 +3468,24 @@  discard block
 block discarded – undo
3468 3468
  *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.
3469 3469
  * @return string Dashboard URL link with optional path appended.
3470 3470
  */
3471
-function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {
3471
+function get_dashboard_url($user_id = 0, $path = '', $scheme = 'admin') {
3472 3472
 	$user_id = $user_id ? (int) $user_id : get_current_user_id();
3473 3473
 
3474
-	$blogs = get_blogs_of_user( $user_id );
3475
-	if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty($blogs) ) {
3476
-		$url = user_admin_url( $path, $scheme );
3477
-	} elseif ( ! is_multisite() ) {
3478
-		$url = admin_url( $path, $scheme );
3474
+	$blogs = get_blogs_of_user($user_id);
3475
+	if (is_multisite() && ! user_can($user_id, 'manage_network') && empty($blogs)) {
3476
+		$url = user_admin_url($path, $scheme);
3477
+	} elseif ( ! is_multisite()) {
3478
+		$url = admin_url($path, $scheme);
3479 3479
 	} else {
3480 3480
 		$current_blog = get_current_blog_id();
3481
-		if ( $current_blog  && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
3482
-			$url = admin_url( $path, $scheme );
3481
+		if ($current_blog && (user_can($user_id, 'manage_network') || in_array($current_blog, array_keys($blogs)))) {
3482
+			$url = admin_url($path, $scheme);
3483 3483
 		} else {
3484
-			$active = get_active_blog_for_user( $user_id );
3485
-			if ( $active )
3486
-				$url = get_admin_url( $active->blog_id, $path, $scheme );
3484
+			$active = get_active_blog_for_user($user_id);
3485
+			if ($active)
3486
+				$url = get_admin_url($active->blog_id, $path, $scheme);
3487 3487
 			else
3488
-				$url = user_admin_url( $path, $scheme );
3488
+				$url = user_admin_url($path, $scheme);
3489 3489
 		}
3490 3490
 	}
3491 3491
 
@@ -3500,7 +3500,7 @@  discard block
 block discarded – undo
3500 3500
 	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
3501 3501
 	 *                        'login_post', 'admin', 'relative' or null.
3502 3502
 	 */
3503
-	return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme);
3503
+	return apply_filters('user_dashboard_url', $url, $user_id, $path, $scheme);
3504 3504
 }
3505 3505
 
3506 3506
 /**
@@ -3513,15 +3513,15 @@  discard block
 block discarded – undo
3513 3513
  *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.
3514 3514
  * @return string Dashboard URL link with optional path appended.
3515 3515
  */
3516
-function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
3516
+function get_edit_profile_url($user_id = 0, $scheme = 'admin') {
3517 3517
 	$user_id = $user_id ? (int) $user_id : get_current_user_id();
3518 3518
 
3519
-	if ( is_user_admin() )
3520
-		$url = user_admin_url( 'profile.php', $scheme );
3521
-	elseif ( is_network_admin() )
3522
-		$url = network_admin_url( 'profile.php', $scheme );
3519
+	if (is_user_admin())
3520
+		$url = user_admin_url('profile.php', $scheme);
3521
+	elseif (is_network_admin())
3522
+		$url = network_admin_url('profile.php', $scheme);
3523 3523
 	else
3524
-		$url = get_dashboard_url( $user_id, 'profile.php', $scheme );
3524
+		$url = get_dashboard_url($user_id, 'profile.php', $scheme);
3525 3525
 
3526 3526
 	/**
3527 3527
 	 * Filters the URL for a user's profile editor.
@@ -3533,7 +3533,7 @@  discard block
 block discarded – undo
3533 3533
 	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
3534 3534
 	 *                        'login_post', 'admin', 'relative' or null.
3535 3535
 	 */
3536
-	return apply_filters( 'edit_profile_url', $url, $user_id, $scheme);
3536
+	return apply_filters('edit_profile_url', $url, $user_id, $scheme);
3537 3537
 }
3538 3538
 
3539 3539
 /**
@@ -3548,33 +3548,33 @@  discard block
 block discarded – undo
3548 3548
  * @return string|false The canonical URL, or false if the post does not exist or has not
3549 3549
  *                      been published yet.
3550 3550
  */
3551
-function wp_get_canonical_url( $post = null ) {
3552
-	$post = get_post( $post );
3551
+function wp_get_canonical_url($post = null) {
3552
+	$post = get_post($post);
3553 3553
 
3554
-	if ( ! $post ) {
3554
+	if ( ! $post) {
3555 3555
 		return false;
3556 3556
 	}
3557 3557
 
3558
-	if ( 'publish' !== $post->post_status ) {
3558
+	if ('publish' !== $post->post_status) {
3559 3559
 		return false;
3560 3560
 	}
3561 3561
 
3562
-	$canonical_url = get_permalink( $post );
3562
+	$canonical_url = get_permalink($post);
3563 3563
 
3564 3564
 	// If a canonical is being generated for the current page, make sure it has pagination if needed.
3565
-	if ( $post->ID === get_queried_object_id() ) {
3566
-		$page = get_query_var( 'page', 0 );
3567
-		if ( $page >= 2 ) {
3568
-			if ( '' == get_option( 'permalink_structure' ) ) {
3569
-				$canonical_url = add_query_arg( 'page', $page, $canonical_url );
3565
+	if ($post->ID === get_queried_object_id()) {
3566
+		$page = get_query_var('page', 0);
3567
+		if ($page >= 2) {
3568
+			if ('' == get_option('permalink_structure')) {
3569
+				$canonical_url = add_query_arg('page', $page, $canonical_url);
3570 3570
 			} else {
3571
-				$canonical_url = trailingslashit( $canonical_url ) . user_trailingslashit( $page, 'single_paged' );
3571
+				$canonical_url = trailingslashit($canonical_url).user_trailingslashit($page, 'single_paged');
3572 3572
 			}
3573 3573
 		}
3574 3574
 
3575
-		$cpage = get_query_var( 'cpage', 0 );
3576
-		if ( $cpage ) {
3577
-			$canonical_url = get_comments_pagenum_link( $cpage );
3575
+		$cpage = get_query_var('cpage', 0);
3576
+		if ($cpage) {
3577
+			$canonical_url = get_comments_pagenum_link($cpage);
3578 3578
 		}
3579 3579
 	}
3580 3580
 
@@ -3586,7 +3586,7 @@  discard block
 block discarded – undo
3586 3586
 	 * @param string  $canonical_url The post's canonical URL.
3587 3587
 	 * @param WP_Post $post          Post object.
3588 3588
 	 */
3589
-	return apply_filters( 'get_canonical_url', $canonical_url, $post );
3589
+	return apply_filters('get_canonical_url', $canonical_url, $post);
3590 3590
 }
3591 3591
 
3592 3592
 /**
@@ -3596,20 +3596,20 @@  discard block
 block discarded – undo
3596 3596
  * @since 4.6.0 Adjusted to use wp_get_canonical_url().
3597 3597
  */
3598 3598
 function rel_canonical() {
3599
-	if ( ! is_singular() ) {
3599
+	if ( ! is_singular()) {
3600 3600
 		return;
3601 3601
 	}
3602 3602
 
3603 3603
 	$id = get_queried_object_id();
3604 3604
 
3605
-	if ( 0 === $id ) {
3605
+	if (0 === $id) {
3606 3606
 		return;
3607 3607
 	}
3608 3608
 
3609
-	$url = wp_get_canonical_url( $id );
3609
+	$url = wp_get_canonical_url($id);
3610 3610
 
3611
-	if ( ! empty( $url ) ) {
3612
-		echo '<link rel="canonical" href="' . esc_url( $url ) . '" />' . "\n";
3611
+	if ( ! empty($url)) {
3612
+		echo '<link rel="canonical" href="'.esc_url($url).'" />'."\n";
3613 3613
 	}
3614 3614
 }
3615 3615
 
@@ -3633,7 +3633,7 @@  discard block
 block discarded – undo
3633 3633
  * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks
3634 3634
  *                are not enabled.
3635 3635
  */
3636
-function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) {
3636
+function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) {
3637 3637
 	/**
3638 3638
 	 * Filters whether to preempt generating a shortlink for the given post.
3639 3639
 	 *
@@ -3647,32 +3647,32 @@  discard block
 block discarded – undo
3647 3647
 	 * @param string      $context     The context for the link. One of 'post' or 'query',
3648 3648
 	 * @param bool        $allow_slugs Whether to allow post slugs in the shortlink.
3649 3649
 	 */
3650
-	$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );
3650
+	$shortlink = apply_filters('pre_get_shortlink', false, $id, $context, $allow_slugs);
3651 3651
 
3652
-	if ( false !== $shortlink ) {
3652
+	if (false !== $shortlink) {
3653 3653
 		return $shortlink;
3654 3654
 	}
3655 3655
 
3656 3656
 	$post_id = 0;
3657
-	if ( 'query' == $context && is_singular() ) {
3657
+	if ('query' == $context && is_singular()) {
3658 3658
 		$post_id = get_queried_object_id();
3659
-		$post = get_post( $post_id );
3660
-	} elseif ( 'post' == $context ) {
3661
-		$post = get_post( $id );
3662
-		if ( ! empty( $post->ID ) )
3659
+		$post = get_post($post_id);
3660
+	} elseif ('post' == $context) {
3661
+		$post = get_post($id);
3662
+		if ( ! empty($post->ID))
3663 3663
 			$post_id = $post->ID;
3664 3664
 	}
3665 3665
 
3666 3666
 	$shortlink = '';
3667 3667
 
3668 3668
 	// Return p= link for all public post types.
3669
-	if ( ! empty( $post_id ) ) {
3670
-		$post_type = get_post_type_object( $post->post_type );
3669
+	if ( ! empty($post_id)) {
3670
+		$post_type = get_post_type_object($post->post_type);
3671 3671
 
3672
-		if ( 'page' === $post->post_type && $post->ID == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) ) {
3673
-			$shortlink = home_url( '/' );
3674
-		} elseif ( $post_type->public ) {
3675
-			$shortlink = home_url( '?p=' . $post_id );
3672
+		if ('page' === $post->post_type && $post->ID == get_option('page_on_front') && 'page' == get_option('show_on_front')) {
3673
+			$shortlink = home_url('/');
3674
+		} elseif ($post_type->public) {
3675
+			$shortlink = home_url('?p='.$post_id);
3676 3676
 		}
3677 3677
 	}
3678 3678
 
@@ -3686,7 +3686,7 @@  discard block
 block discarded – undo
3686 3686
 	 * @param string $context     The context for the link. One of 'post' or 'query',
3687 3687
 	 * @param bool   $allow_slugs Whether to allow post slugs in the shortlink. Not used by default.
3688 3688
 	 */
3689
-	return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
3689
+	return apply_filters('get_shortlink', $shortlink, $id, $context, $allow_slugs);
3690 3690
 }
3691 3691
 
3692 3692
 /**
@@ -3697,12 +3697,12 @@  discard block
 block discarded – undo
3697 3697
  * @since 3.0.0
3698 3698
  */
3699 3699
 function wp_shortlink_wp_head() {
3700
-	$shortlink = wp_get_shortlink( 0, 'query' );
3700
+	$shortlink = wp_get_shortlink(0, 'query');
3701 3701
 
3702
-	if ( empty( $shortlink ) )
3702
+	if (empty($shortlink))
3703 3703
 		return;
3704 3704
 
3705
-	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
3705
+	echo "<link rel='shortlink' href='".esc_url($shortlink)."' />\n";
3706 3706
 }
3707 3707
 
3708 3708
 /**
@@ -3713,15 +3713,15 @@  discard block
 block discarded – undo
3713 3713
  * @since 3.0.0
3714 3714
  */
3715 3715
 function wp_shortlink_header() {
3716
-	if ( headers_sent() )
3716
+	if (headers_sent())
3717 3717
 		return;
3718 3718
 
3719 3719
 	$shortlink = wp_get_shortlink(0, 'query');
3720 3720
 
3721
-	if ( empty($shortlink) )
3721
+	if (empty($shortlink))
3722 3722
 		return;
3723 3723
 
3724
-	header('Link: <' . $shortlink . '>; rel=shortlink', false);
3724
+	header('Link: <'.$shortlink.'>; rel=shortlink', false);
3725 3725
 }
3726 3726
 
3727 3727
 /**
@@ -3738,19 +3738,19 @@  discard block
 block discarded – undo
3738 3738
  * @param string $before Optional HTML to display before the link. Default empty.
3739 3739
  * @param string $after  Optional HTML to display after the link. Default empty.
3740 3740
  */
3741
-function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
3741
+function the_shortlink($text = '', $title = '', $before = '', $after = '') {
3742 3742
 	$post = get_post();
3743 3743
 
3744
-	if ( empty( $text ) )
3744
+	if (empty($text))
3745 3745
 		$text = __('This is the short link.');
3746 3746
 
3747
-	if ( empty( $title ) )
3748
-		$title = the_title_attribute( array( 'echo' => false ) );
3747
+	if (empty($title))
3748
+		$title = the_title_attribute(array('echo' => false));
3749 3749
 
3750
-	$shortlink = wp_get_shortlink( $post->ID );
3750
+	$shortlink = wp_get_shortlink($post->ID);
3751 3751
 
3752
-	if ( !empty( $shortlink ) ) {
3753
-		$link = '<a rel="shortlink" href="' . esc_url( $shortlink ) . '" title="' . $title . '">' . $text . '</a>';
3752
+	if ( ! empty($shortlink)) {
3753
+		$link = '<a rel="shortlink" href="'.esc_url($shortlink).'" title="'.$title.'">'.$text.'</a>';
3754 3754
 
3755 3755
 		/**
3756 3756
 		 * Filters the short link anchor tag for a post.
@@ -3762,7 +3762,7 @@  discard block
 block discarded – undo
3762 3762
 		 * @param string $text      Shortlink's text.
3763 3763
 		 * @param string $title     Shortlink's title attribute.
3764 3764
 		 */
3765
-		$link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );
3765
+		$link = apply_filters('the_shortlink', $link, $shortlink, $text, $title);
3766 3766
 		echo $before, $link, $after;
3767 3767
 	}
3768 3768
 }
@@ -3795,8 +3795,8 @@  discard block
 block discarded – undo
3795 3795
  * }
3796 3796
  * @return false|string The URL of the avatar we found, or false if we couldn't find an avatar.
3797 3797
  */
3798
-function get_avatar_url( $id_or_email, $args = null ) {
3799
-	$args = get_avatar_data( $id_or_email, $args );
3798
+function get_avatar_url($id_or_email, $args = null) {
3799
+	$args = get_avatar_data($id_or_email, $args);
3800 3800
 	return $args['url'];
3801 3801
 }
3802 3802
 
@@ -3836,51 +3836,51 @@  discard block
 block discarded – undo
3836 3836
  *     @type string $url          The URL of the avatar we found.
3837 3837
  * }
3838 3838
  */
3839
-function get_avatar_data( $id_or_email, $args = null ) {
3840
-	$args = wp_parse_args( $args, array(
3839
+function get_avatar_data($id_or_email, $args = null) {
3840
+	$args = wp_parse_args($args, array(
3841 3841
 		'size'           => 96,
3842 3842
 		'height'         => null,
3843 3843
 		'width'          => null,
3844
-		'default'        => get_option( 'avatar_default', 'mystery' ),
3844
+		'default'        => get_option('avatar_default', 'mystery'),
3845 3845
 		'force_default'  => false,
3846
-		'rating'         => get_option( 'avatar_rating' ),
3846
+		'rating'         => get_option('avatar_rating'),
3847 3847
 		'scheme'         => null,
3848 3848
 		'processed_args' => null, // if used, should be a reference
3849 3849
 		'extra_attr'     => '',
3850
-	) );
3850
+	));
3851 3851
 
3852
-	if ( is_numeric( $args['size'] ) ) {
3853
-		$args['size'] = absint( $args['size'] );
3854
-		if ( ! $args['size'] ) {
3852
+	if (is_numeric($args['size'])) {
3853
+		$args['size'] = absint($args['size']);
3854
+		if ( ! $args['size']) {
3855 3855
 			$args['size'] = 96;
3856 3856
 		}
3857 3857
 	} else {
3858 3858
 		$args['size'] = 96;
3859 3859
 	}
3860 3860
 
3861
-	if ( is_numeric( $args['height'] ) ) {
3862
-		$args['height'] = absint( $args['height'] );
3863
-		if ( ! $args['height'] ) {
3861
+	if (is_numeric($args['height'])) {
3862
+		$args['height'] = absint($args['height']);
3863
+		if ( ! $args['height']) {
3864 3864
 			$args['height'] = $args['size'];
3865 3865
 		}
3866 3866
 	} else {
3867 3867
 		$args['height'] = $args['size'];
3868 3868
 	}
3869 3869
 
3870
-	if ( is_numeric( $args['width'] ) ) {
3871
-		$args['width'] = absint( $args['width'] );
3872
-		if ( ! $args['width'] ) {
3870
+	if (is_numeric($args['width'])) {
3871
+		$args['width'] = absint($args['width']);
3872
+		if ( ! $args['width']) {
3873 3873
 			$args['width'] = $args['size'];
3874 3874
 		}
3875 3875
 	} else {
3876 3876
 		$args['width'] = $args['size'];
3877 3877
 	}
3878 3878
 
3879
-	if ( empty( $args['default'] ) ) {
3880
-		$args['default'] = get_option( 'avatar_default', 'mystery' );
3879
+	if (empty($args['default'])) {
3880
+		$args['default'] = get_option('avatar_default', 'mystery');
3881 3881
 	}
3882 3882
 
3883
-	switch ( $args['default'] ) {
3883
+	switch ($args['default']) {
3884 3884
 		case 'mm' :
3885 3885
 		case 'mystery' :
3886 3886
 		case 'mysteryman' :
@@ -3893,7 +3893,7 @@  discard block
 block discarded – undo
3893 3893
 
3894 3894
 	$args['force_default'] = (bool) $args['force_default'];
3895 3895
 
3896
-	$args['rating'] = strtolower( $args['rating'] );
3896
+	$args['rating'] = strtolower($args['rating']);
3897 3897
 
3898 3898
 	$args['found_avatar'] = false;
3899 3899
 
@@ -3910,38 +3910,38 @@  discard block
 block discarded – undo
3910 3910
 	 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
3911 3911
 	 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
3912 3912
 	 */
3913
-	$args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );
3913
+	$args = apply_filters('pre_get_avatar_data', $args, $id_or_email);
3914 3914
 
3915
-	if ( isset( $args['url'] ) && ! is_null( $args['url'] ) ) {
3915
+	if (isset($args['url']) && ! is_null($args['url'])) {
3916 3916
 		/** This filter is documented in wp-includes/link-template.php */
3917
-		return apply_filters( 'get_avatar_data', $args, $id_or_email );
3917
+		return apply_filters('get_avatar_data', $args, $id_or_email);
3918 3918
 	}
3919 3919
 
3920 3920
 	$email_hash = '';
3921 3921
 	$user = $email = false;
3922 3922
 
3923
-	if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {
3924
-		$id_or_email = get_comment( $id_or_email );
3923
+	if (is_object($id_or_email) && isset($id_or_email->comment_ID)) {
3924
+		$id_or_email = get_comment($id_or_email);
3925 3925
 	}
3926 3926
 
3927 3927
 	// Process the user identifier.
3928
-	if ( is_numeric( $id_or_email ) ) {
3929
-		$user = get_user_by( 'id', absint( $id_or_email ) );
3930
-	} elseif ( is_string( $id_or_email ) ) {
3931
-		if ( strpos( $id_or_email, '@md5.gravatar.com' ) ) {
3928
+	if (is_numeric($id_or_email)) {
3929
+		$user = get_user_by('id', absint($id_or_email));
3930
+	} elseif (is_string($id_or_email)) {
3931
+		if (strpos($id_or_email, '@md5.gravatar.com')) {
3932 3932
 			// md5 hash
3933
-			list( $email_hash ) = explode( '@', $id_or_email );
3933
+			list($email_hash) = explode('@', $id_or_email);
3934 3934
 		} else {
3935 3935
 			// email address
3936 3936
 			$email = $id_or_email;
3937 3937
 		}
3938
-	} elseif ( $id_or_email instanceof WP_User ) {
3938
+	} elseif ($id_or_email instanceof WP_User) {
3939 3939
 		// User Object
3940 3940
 		$user = $id_or_email;
3941
-	} elseif ( $id_or_email instanceof WP_Post ) {
3941
+	} elseif ($id_or_email instanceof WP_Post) {
3942 3942
 		// Post Object
3943
-		$user = get_user_by( 'id', (int) $id_or_email->post_author );
3944
-	} elseif ( $id_or_email instanceof WP_Comment ) {
3943
+		$user = get_user_by('id', (int) $id_or_email->post_author);
3944
+	} elseif ($id_or_email instanceof WP_Comment) {
3945 3945
 		/**
3946 3946
 		 * Filters the list of allowed comment types for retrieving avatars.
3947 3947
 		 *
@@ -3949,36 +3949,36 @@  discard block
 block discarded – undo
3949 3949
 		 *
3950 3950
 		 * @param array $types An array of content types. Default only contains 'comment'.
3951 3951
 		 */
3952
-		$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
3953
-		if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) {
3952
+		$allowed_comment_types = apply_filters('get_avatar_comment_types', array('comment'));
3953
+		if ( ! empty($id_or_email->comment_type) && ! in_array($id_or_email->comment_type, (array) $allowed_comment_types)) {
3954 3954
 			$args['url'] = false;
3955 3955
 			/** This filter is documented in wp-includes/link-template.php */
3956
-			return apply_filters( 'get_avatar_data', $args, $id_or_email );
3956
+			return apply_filters('get_avatar_data', $args, $id_or_email);
3957 3957
 		}
3958 3958
 
3959
-		if ( ! empty( $id_or_email->user_id ) ) {
3960
-			$user = get_user_by( 'id', (int) $id_or_email->user_id );
3959
+		if ( ! empty($id_or_email->user_id)) {
3960
+			$user = get_user_by('id', (int) $id_or_email->user_id);
3961 3961
 		}
3962
-		if ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) {
3962
+		if (( ! $user || is_wp_error($user)) && ! empty($id_or_email->comment_author_email)) {
3963 3963
 			$email = $id_or_email->comment_author_email;
3964 3964
 		}
3965 3965
 	}
3966 3966
 
3967
-	if ( ! $email_hash ) {
3968
-		if ( $user ) {
3967
+	if ( ! $email_hash) {
3968
+		if ($user) {
3969 3969
 			$email = $user->user_email;
3970 3970
 		}
3971 3971
 
3972
-		if ( $email ) {
3973
-			$email_hash = md5( strtolower( trim( $email ) ) );
3972
+		if ($email) {
3973
+			$email_hash = md5(strtolower(trim($email)));
3974 3974
 		}
3975 3975
 	}
3976 3976
 
3977
-	if ( $email_hash ) {
3977
+	if ($email_hash) {
3978 3978
 		$args['found_avatar'] = true;
3979
-		$gravatar_server = hexdec( $email_hash[0] ) % 3;
3979
+		$gravatar_server = hexdec($email_hash[0]) % 3;
3980 3980
 	} else {
3981
-		$gravatar_server = rand( 0, 2 );
3981
+		$gravatar_server = rand(0, 2);
3982 3982
 	}
3983 3983
 
3984 3984
 	$url_args = array(
@@ -3988,15 +3988,15 @@  discard block
 block discarded – undo
3988 3988
 		'r' => $args['rating'],
3989 3989
 	);
3990 3990
 
3991
-	if ( is_ssl() ) {
3992
-		$url = 'https://secure.gravatar.com/avatar/' . $email_hash;
3991
+	if (is_ssl()) {
3992
+		$url = 'https://secure.gravatar.com/avatar/'.$email_hash;
3993 3993
 	} else {
3994
-		$url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );
3994
+		$url = sprintf('http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash);
3995 3995
 	}
3996 3996
 
3997 3997
 	$url = add_query_arg(
3998
-		rawurlencode_deep( array_filter( $url_args ) ),
3999
-		set_url_scheme( $url, $args['scheme'] )
3998
+		rawurlencode_deep(array_filter($url_args)),
3999
+		set_url_scheme($url, $args['scheme'])
4000 4000
 	);
4001 4001
 
4002 4002
 	/**
@@ -4009,7 +4009,7 @@  discard block
 block discarded – undo
4009 4009
 	 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
4010 4010
 	 * @param array  $args        Arguments passed to get_avatar_data(), after processing.
4011 4011
 	 */
4012
-	$args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );
4012
+	$args['url'] = apply_filters('get_avatar_url', $url, $id_or_email, $args);
4013 4013
 
4014 4014
 	/**
4015 4015
 	 * Filters the avatar data.
@@ -4020,7 +4020,7 @@  discard block
 block discarded – undo
4020 4020
 	 * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
4021 4021
 	 *                            user email, WP_User object, WP_Post object, or WP_Comment object.
4022 4022
 	 */
4023
-	return apply_filters( 'get_avatar_data', $args, $id_or_email );
4023
+	return apply_filters('get_avatar_data', $args, $id_or_email);
4024 4024
 }
4025 4025
 
4026 4026
 /**
@@ -4034,15 +4034,15 @@  discard block
 block discarded – undo
4034 4034
  * @param string $file Optional. File to search for in the stylesheet directory.
4035 4035
  * @return string The URL of the file.
4036 4036
  */
4037
-function get_theme_file_uri( $file = '' ) {
4038
-	$file = ltrim( $file, '/' );
4037
+function get_theme_file_uri($file = '') {
4038
+	$file = ltrim($file, '/');
4039 4039
 
4040
-	if ( empty( $file ) ) {
4040
+	if (empty($file)) {
4041 4041
 		$url = get_stylesheet_directory_uri();
4042
-	} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
4043
-		$url = get_stylesheet_directory_uri() . '/' . $file;
4042
+	} elseif (file_exists(get_stylesheet_directory().'/'.$file)) {
4043
+		$url = get_stylesheet_directory_uri().'/'.$file;
4044 4044
 	} else {
4045
-		$url = get_template_directory_uri() . '/' . $file;
4045
+		$url = get_template_directory_uri().'/'.$file;
4046 4046
 	}
4047 4047
 
4048 4048
 	/**
@@ -4053,7 +4053,7 @@  discard block
 block discarded – undo
4053 4053
 	 * @param string $url  The file URL.
4054 4054
 	 * @param string $file The requested file to search for.
4055 4055
 	 */
4056
-	return apply_filters( 'theme_file_uri', $url, $file );
4056
+	return apply_filters('theme_file_uri', $url, $file);
4057 4057
 }
4058 4058
 
4059 4059
 /**
@@ -4064,13 +4064,13 @@  discard block
 block discarded – undo
4064 4064
  * @param string $file Optional. File to return the URL for in the template directory.
4065 4065
  * @return string The URL of the file.
4066 4066
  */
4067
-function get_parent_theme_file_uri( $file = '' ) {
4068
-	$file = ltrim( $file, '/' );
4067
+function get_parent_theme_file_uri($file = '') {
4068
+	$file = ltrim($file, '/');
4069 4069
 
4070
-	if ( empty( $file ) ) {
4070
+	if (empty($file)) {
4071 4071
 		$url = get_template_directory_uri();
4072 4072
 	} else {
4073
-		$url = get_template_directory_uri() . '/' . $file;
4073
+		$url = get_template_directory_uri().'/'.$file;
4074 4074
 	}
4075 4075
 
4076 4076
 	/**
@@ -4081,7 +4081,7 @@  discard block
 block discarded – undo
4081 4081
 	 * @param string $url  The file URL.
4082 4082
 	 * @param string $file The requested file to search for.
4083 4083
 	 */
4084
-	return apply_filters( 'parent_theme_file_uri', $url, $file );
4084
+	return apply_filters('parent_theme_file_uri', $url, $file);
4085 4085
 }
4086 4086
 
4087 4087
 /**
@@ -4095,15 +4095,15 @@  discard block
 block discarded – undo
4095 4095
  * @param string $file Optional. File to search for in the stylesheet directory.
4096 4096
  * @return string The path of the file.
4097 4097
  */
4098
-function get_theme_file_path( $file = '' ) {
4099
-	$file = ltrim( $file, '/' );
4098
+function get_theme_file_path($file = '') {
4099
+	$file = ltrim($file, '/');
4100 4100
 
4101
-	if ( empty( $file ) ) {
4101
+	if (empty($file)) {
4102 4102
 		$path = get_stylesheet_directory();
4103
-	} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
4104
-		$path = get_stylesheet_directory() . '/' . $file;
4103
+	} elseif (file_exists(get_stylesheet_directory().'/'.$file)) {
4104
+		$path = get_stylesheet_directory().'/'.$file;
4105 4105
 	} else {
4106
-		$path = get_template_directory() . '/' . $file;
4106
+		$path = get_template_directory().'/'.$file;
4107 4107
 	}
4108 4108
 
4109 4109
 	/**
@@ -4114,7 +4114,7 @@  discard block
 block discarded – undo
4114 4114
 	 * @param string $path The file path.
4115 4115
 	 * @param string $file The requested file to search for.
4116 4116
 	 */
4117
-	return apply_filters( 'theme_file_path', $path, $file );
4117
+	return apply_filters('theme_file_path', $path, $file);
4118 4118
 }
4119 4119
 
4120 4120
 /**
@@ -4125,13 +4125,13 @@  discard block
 block discarded – undo
4125 4125
  * @param string $file Optional. File to return the path for in the template directory.
4126 4126
  * @return string The path of the file.
4127 4127
  */
4128
-function get_parent_theme_file_path( $file = '' ) {
4129
-	$file = ltrim( $file, '/' );
4128
+function get_parent_theme_file_path($file = '') {
4129
+	$file = ltrim($file, '/');
4130 4130
 
4131
-	if ( empty( $file ) ) {
4131
+	if (empty($file)) {
4132 4132
 		$path = get_template_directory();
4133 4133
 	} else {
4134
-		$path = get_template_directory() . '/' . $file;
4134
+		$path = get_template_directory().'/'.$file;
4135 4135
 	}
4136 4136
 
4137 4137
 	/**
@@ -4142,5 +4142,5 @@  discard block
 block discarded – undo
4142 4142
 	 * @param string $path The file path.
4143 4143
 	 * @param string $file The requested file to search for.
4144 4144
 	 */
4145
-	return apply_filters( 'parent_theme_file_path', $path, $file );
4145
+	return apply_filters('parent_theme_file_path', $path, $file);
4146 4146
 }
Please login to merge, or discard this patch.
Braces   +471 added lines, -338 removed lines patch added patch discarded remove patch
@@ -46,10 +46,11 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function user_trailingslashit($string, $type_of_url = '') {
48 48
 	global $wp_rewrite;
49
-	if ( $wp_rewrite->use_trailing_slashes )
50
-		$string = trailingslashit($string);
51
-	else
52
-		$string = untrailingslashit($string);
49
+	if ( $wp_rewrite->use_trailing_slashes ) {
50
+			$string = trailingslashit($string);
51
+	} else {
52
+			$string = untrailingslashit($string);
53
+	}
53 54
 
54 55
 	/**
55 56
 	 * Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes.
@@ -137,15 +138,17 @@  discard block
 block discarded – undo
137 138
 		$sample = false;
138 139
 	}
139 140
 
140
-	if ( empty($post->ID) )
141
-		return false;
141
+	if ( empty($post->ID) ) {
142
+			return false;
143
+	}
142 144
 
143
-	if ( $post->post_type == 'page' )
144
-		return get_page_link($post, $leavename, $sample);
145
-	elseif ( $post->post_type == 'attachment' )
146
-		return get_attachment_link( $post, $leavename );
147
-	elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) )
148
-		return get_post_permalink($post, $leavename, $sample);
145
+	if ( $post->post_type == 'page' ) {
146
+			return get_page_link($post, $leavename, $sample);
147
+	} elseif ( $post->post_type == 'attachment' ) {
148
+			return get_attachment_link( $post, $leavename );
149
+	} elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) {
150
+			return get_post_permalink($post, $leavename, $sample);
151
+	}
149 152
 
150 153
 	$permalink = get_option('permalink_structure');
151 154
 
@@ -186,8 +189,9 @@  discard block
 block discarded – undo
186 189
 
187 190
 				$category_object = get_term( $category_object, 'category' );
188 191
 				$category = $category_object->slug;
189
-				if ( $parent = $category_object->parent )
190
-					$category = get_category_parents($parent, false, '/', true) . $category;
192
+				if ( $parent = $category_object->parent ) {
193
+									$category = get_category_parents($parent, false, '/', true) . $category;
194
+				}
191 195
 			}
192 196
 			// show default category in permalinks, without
193 197
 			// having to assign it explicitly
@@ -257,8 +261,9 @@  discard block
 block discarded – undo
257 261
 
258 262
 	$post = get_post($id);
259 263
 
260
-	if ( is_wp_error( $post ) )
261
-		return $post;
264
+	if ( is_wp_error( $post ) ) {
265
+			return $post;
266
+	}
262 267
 
263 268
 	$post_link = $wp_rewrite->get_extra_permastruct($post->post_type);
264 269
 
@@ -278,10 +283,11 @@  discard block
 block discarded – undo
278 283
 		}
279 284
 		$post_link = home_url( user_trailingslashit($post_link) );
280 285
 	} else {
281
-		if ( $post_type->query_var && ( isset($post->post_status) && !$draft_or_pending ) )
282
-			$post_link = add_query_arg($post_type->query_var, $slug, '');
283
-		else
284
-			$post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
286
+		if ( $post_type->query_var && ( isset($post->post_status) && !$draft_or_pending ) ) {
287
+					$post_link = add_query_arg($post_type->query_var, $slug, '');
288
+		} else {
289
+					$post_link = add_query_arg(array('post_type' => $post->post_type, 'p' => $post->ID), '');
290
+		}
285 291
 		$post_link = home_url($post_link);
286 292
 	}
287 293
 
@@ -314,10 +320,11 @@  discard block
 block discarded – undo
314 320
 function get_page_link( $post = false, $leavename = false, $sample = false ) {
315 321
 	$post = get_post( $post );
316 322
 
317
-	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) )
318
-		$link = home_url('/');
319
-	else
320
-		$link = _get_page_link( $post, $leavename, $sample );
323
+	if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) ) {
324
+			$link = home_url('/');
325
+	} else {
326
+			$link = _get_page_link( $post, $leavename, $sample );
327
+	}
321 328
 
322 329
 	/**
323 330
 	 * Filters the permalink for a page.
@@ -403,27 +410,36 @@  discard block
 block discarded – undo
403 410
 	}
404 411
 
405 412
 	if ( $wp_rewrite->using_permalinks() && $parent ) {
406
-		if ( 'page' == $parent->post_type )
407
-			$parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front
408
-		else
409
-			$parentlink = get_permalink( $post->post_parent );
413
+		if ( 'page' == $parent->post_type ) {
414
+					$parentlink = _get_page_link( $post->post_parent );
415
+		}
416
+		// Ignores page_on_front
417
+		else {
418
+					$parentlink = get_permalink( $post->post_parent );
419
+		}
410 420
 
411
-		if ( is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') )
412
-			$name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
413
-		else
414
-			$name = $post->post_name;
421
+		if ( is_numeric($post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) {
422
+					$name = 'attachment/' . $post->post_name;
423
+		}
424
+		// <permalink>/<int>/ is paged so we use the explicit attachment marker
425
+		else {
426
+					$name = $post->post_name;
427
+		}
415 428
 
416
-		if ( strpos($parentlink, '?') === false )
417
-			$link = user_trailingslashit( trailingslashit($parentlink) . '%postname%' );
429
+		if ( strpos($parentlink, '?') === false ) {
430
+					$link = user_trailingslashit( trailingslashit($parentlink) . '%postname%' );
431
+		}
418 432
 
419
-		if ( ! $leavename )
420
-			$link = str_replace( '%postname%', $name, $link );
433
+		if ( ! $leavename ) {
434
+					$link = str_replace( '%postname%', $name, $link );
435
+		}
421 436
 	} elseif ( $wp_rewrite->using_permalinks() && ! $leavename ) {
422 437
 		$link = home_url( user_trailingslashit( $post->post_name ) );
423 438
 	}
424 439
 
425
-	if ( ! $link )
426
-		$link = home_url( '/?attachment_id=' . $post->ID );
440
+	if ( ! $link ) {
441
+			$link = home_url( '/?attachment_id=' . $post->ID );
442
+	}
427 443
 
428 444
 	/**
429 445
 	 * Filters the permalink for an attachment.
@@ -448,8 +464,9 @@  discard block
 block discarded – undo
448 464
  */
449 465
 function get_year_link( $year ) {
450 466
 	global $wp_rewrite;
451
-	if ( !$year )
452
-		$year = gmdate('Y', current_time('timestamp'));
467
+	if ( !$year ) {
468
+			$year = gmdate('Y', current_time('timestamp'));
469
+	}
453 470
 	$yearlink = $wp_rewrite->get_year_permastruct();
454 471
 	if ( !empty($yearlink) ) {
455 472
 		$yearlink = str_replace('%year%', $year, $yearlink);
@@ -482,10 +499,12 @@  discard block
 block discarded – undo
482 499
  */
483 500
 function get_month_link($year, $month) {
484 501
 	global $wp_rewrite;
485
-	if ( !$year )
486
-		$year = gmdate('Y', current_time('timestamp'));
487
-	if ( !$month )
488
-		$month = gmdate('m', current_time('timestamp'));
502
+	if ( !$year ) {
503
+			$year = gmdate('Y', current_time('timestamp'));
504
+	}
505
+	if ( !$month ) {
506
+			$month = gmdate('m', current_time('timestamp'));
507
+	}
489 508
 	$monthlink = $wp_rewrite->get_month_permastruct();
490 509
 	if ( !empty($monthlink) ) {
491 510
 		$monthlink = str_replace('%year%', $year, $monthlink);
@@ -521,12 +540,15 @@  discard block
 block discarded – undo
521 540
  */
522 541
 function get_day_link($year, $month, $day) {
523 542
 	global $wp_rewrite;
524
-	if ( !$year )
525
-		$year = gmdate('Y', current_time('timestamp'));
526
-	if ( !$month )
527
-		$month = gmdate('m', current_time('timestamp'));
528
-	if ( !$day )
529
-		$day = gmdate('j', current_time('timestamp'));
543
+	if ( !$year ) {
544
+			$year = gmdate('Y', current_time('timestamp'));
545
+	}
546
+	if ( !$month ) {
547
+			$month = gmdate('m', current_time('timestamp'));
548
+	}
549
+	if ( !$day ) {
550
+			$day = gmdate('j', current_time('timestamp'));
551
+	}
530 552
 
531 553
 	$daylink = $wp_rewrite->get_day_permastruct();
532 554
 	if ( !empty($daylink) ) {
@@ -594,18 +616,21 @@  discard block
 block discarded – undo
594 616
 			$permalink = $wp_rewrite->get_comment_feed_permastruct();
595 617
 		}
596 618
 
597
-		if ( get_default_feed() == $feed )
598
-			$feed = '';
619
+		if ( get_default_feed() == $feed ) {
620
+					$feed = '';
621
+		}
599 622
 
600 623
 		$permalink = str_replace('%feed%', $feed, $permalink);
601 624
 		$permalink = preg_replace('#/+#', '/', "/$permalink");
602 625
 		$output =  home_url( user_trailingslashit($permalink, 'feed') );
603 626
 	} else {
604
-		if ( empty($feed) )
605
-			$feed = get_default_feed();
627
+		if ( empty($feed) ) {
628
+					$feed = get_default_feed();
629
+		}
606 630
 
607
-		if ( false !== strpos($feed, 'comments_') )
608
-			$feed = str_replace('comments_', 'comments-', $feed);
631
+		if ( false !== strpos($feed, 'comments_') ) {
632
+					$feed = str_replace('comments_', 'comments-', $feed);
633
+		}
609 634
 
610 635
 		$output = home_url("?feed={$feed}");
611 636
 	}
@@ -633,20 +658,23 @@  discard block
 block discarded – undo
633 658
 function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
634 659
 	$post_id = absint( $post_id );
635 660
 
636
-	if ( ! $post_id )
637
-		$post_id = get_the_ID();
661
+	if ( ! $post_id ) {
662
+			$post_id = get_the_ID();
663
+	}
638 664
 
639
-	if ( empty( $feed ) )
640
-		$feed = get_default_feed();
665
+	if ( empty( $feed ) ) {
666
+			$feed = get_default_feed();
667
+	}
641 668
 
642 669
 	$post = get_post( $post_id );
643 670
 	$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
644 671
 
645 672
 	if ( '' != get_option('permalink_structure') ) {
646
-		if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') )
647
-			$url = _get_page_link( $post_id );
648
-		else
649
-			$url = get_permalink($post_id);
673
+		if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') ) {
674
+					$url = _get_page_link( $post_id );
675
+		} else {
676
+					$url = get_permalink($post_id);
677
+		}
650 678
 
651 679
 		if ( $unattached ) {
652 680
 			$url =  home_url( '/feed/' );
@@ -656,8 +684,9 @@  discard block
 block discarded – undo
656 684
 			$url = add_query_arg( 'attachment_id', $post_id, $url );
657 685
 		} else {
658 686
 			$url = trailingslashit($url) . 'feed';
659
-			if ( $feed != get_default_feed() )
660
-				$url .= "/$feed";
687
+			if ( $feed != get_default_feed() ) {
688
+							$url .= "/$feed";
689
+			}
661 690
 			$url = user_trailingslashit($url, 'single_feed');
662 691
 		}
663 692
 	} else {
@@ -728,17 +757,19 @@  discard block
 block discarded – undo
728 757
 	$author_id = (int) $author_id;
729 758
 	$permalink_structure = get_option('permalink_structure');
730 759
 
731
-	if ( empty($feed) )
732
-		$feed = get_default_feed();
760
+	if ( empty($feed) ) {
761
+			$feed = get_default_feed();
762
+	}
733 763
 
734 764
 	if ( '' == $permalink_structure ) {
735 765
 		$link = home_url("?feed=$feed&amp;author=" . $author_id);
736 766
 	} else {
737 767
 		$link = get_author_posts_url($author_id);
738
-		if ( $feed == get_default_feed() )
739
-			$feed_link = 'feed';
740
-		else
741
-			$feed_link = "feed/$feed";
768
+		if ( $feed == get_default_feed() ) {
769
+					$feed_link = 'feed';
770
+		} else {
771
+					$feed_link = "feed/$feed";
772
+		}
742 773
 
743 774
 		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
744 775
 	}
@@ -790,19 +821,20 @@  discard block
 block discarded – undo
790 821
 
791 822
 	$term = get_term( $term_id, $taxonomy  );
792 823
 
793
-	if ( empty( $term ) || is_wp_error( $term ) )
794
-		return false;
824
+	if ( empty( $term ) || is_wp_error( $term ) ) {
825
+			return false;
826
+	}
795 827
 
796
-	if ( empty( $feed ) )
797
-		$feed = get_default_feed();
828
+	if ( empty( $feed ) ) {
829
+			$feed = get_default_feed();
830
+	}
798 831
 
799 832
 	$permalink_structure = get_option( 'permalink_structure' );
800 833
 
801 834
 	if ( '' == $permalink_structure ) {
802 835
 		if ( 'category' == $taxonomy ) {
803 836
 			$link = home_url("?feed=$feed&amp;cat=$term_id");
804
-		}
805
-		elseif ( 'post_tag' == $taxonomy ) {
837
+		} elseif ( 'post_tag' == $taxonomy ) {
806 838
 			$link = home_url("?feed=$feed&amp;tag=$term->slug");
807 839
 		} else {
808 840
 			$t = get_taxonomy( $taxonomy );
@@ -810,10 +842,11 @@  discard block
 block discarded – undo
810 842
 		}
811 843
 	} else {
812 844
 		$link = get_term_link( $term_id, $term->taxonomy );
813
-		if ( $feed == get_default_feed() )
814
-			$feed_link = 'feed';
815
-		else
816
-			$feed_link = "feed/$feed";
845
+		if ( $feed == get_default_feed() ) {
846
+					$feed_link = 'feed';
847
+		} else {
848
+					$feed_link = "feed/$feed";
849
+		}
817 850
 
818 851
 		$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
819 852
 	}
@@ -979,19 +1012,22 @@  discard block
 block discarded – undo
979 1012
  * @return string|void HTML content.
980 1013
  */
981 1014
 function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {
982
-	if ( is_null( $term ) )
983
-		$term = get_queried_object();
1015
+	if ( is_null( $term ) ) {
1016
+			$term = get_queried_object();
1017
+	}
984 1018
 
985
-	if ( ! $term )
986
-		return;
1019
+	if ( ! $term ) {
1020
+			return;
1021
+	}
987 1022
 
988 1023
 	$tax = get_taxonomy( $term->taxonomy );
989 1024
 	if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
990 1025
 		return;
991 1026
 	}
992 1027
 
993
-	if ( empty( $link ) )
994
-		$link = __('Edit This');
1028
+	if ( empty( $link ) ) {
1029
+			$link = __('Edit This');
1030
+	}
995 1031
 
996 1032
 	$link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '">' . $link . '</a>';
997 1033
 
@@ -1005,11 +1041,12 @@  discard block
 block discarded – undo
1005 1041
 	 */
1006 1042
 	$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
1007 1043
 
1008
-	if ( $echo )
1009
-		echo $link;
1010
-	else
1011
-		return $link;
1012
-}
1044
+	if ( $echo ) {
1045
+			echo $link;
1046
+	} else {
1047
+			return $link;
1048
+	}
1049
+	}
1013 1050
 
1014 1051
 /**
1015 1052
  * Retrieves the permalink for a search.
@@ -1024,10 +1061,11 @@  discard block
 block discarded – undo
1024 1061
 function get_search_link( $query = '' ) {
1025 1062
 	global $wp_rewrite;
1026 1063
 
1027
-	if ( empty($query) )
1028
-		$search = get_search_query( false );
1029
-	else
1030
-		$search = stripslashes($query);
1064
+	if ( empty($query) ) {
1065
+			$search = get_search_query( false );
1066
+	} else {
1067
+			$search = stripslashes($query);
1068
+	}
1031 1069
 
1032 1070
 	$permastruct = $wp_rewrite->get_search_permastruct();
1033 1071
 
@@ -1066,8 +1104,9 @@  discard block
 block discarded – undo
1066 1104
 	global $wp_rewrite;
1067 1105
 	$link = get_search_link($search_query);
1068 1106
 
1069
-	if ( empty($feed) )
1070
-		$feed = get_default_feed();
1107
+	if ( empty($feed) ) {
1108
+			$feed = get_default_feed();
1109
+	}
1071 1110
 
1072 1111
 	$permastruct = $wp_rewrite->get_search_permastruct();
1073 1112
 
@@ -1104,17 +1143,19 @@  discard block
 block discarded – undo
1104 1143
 function get_search_comments_feed_link($search_query = '', $feed = '') {
1105 1144
 	global $wp_rewrite;
1106 1145
 
1107
-	if ( empty($feed) )
1108
-		$feed = get_default_feed();
1146
+	if ( empty($feed) ) {
1147
+			$feed = get_default_feed();
1148
+	}
1109 1149
 
1110 1150
 	$link = get_search_feed_link($search_query, $feed);
1111 1151
 
1112 1152
 	$permastruct = $wp_rewrite->get_search_permastruct();
1113 1153
 
1114
-	if ( empty($permastruct) )
1115
-		$link = add_query_arg('feed', 'comments-' . $feed, $link);
1116
-	else
1117
-		$link = add_query_arg('withcomments', 1, $link);
1154
+	if ( empty($permastruct) ) {
1155
+			$link = add_query_arg('feed', 'comments-' . $feed, $link);
1156
+	} else {
1157
+			$link = add_query_arg('withcomments', 1, $link);
1158
+	}
1118 1159
 
1119 1160
 	/** This filter is documented in wp-includes/link-template.php */
1120 1161
 	return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
@@ -1133,8 +1174,9 @@  discard block
 block discarded – undo
1133 1174
  */
1134 1175
 function get_post_type_archive_link( $post_type ) {
1135 1176
 	global $wp_rewrite;
1136
-	if ( ! $post_type_obj = get_post_type_object( $post_type ) )
1137
-		return false;
1177
+	if ( ! $post_type_obj = get_post_type_object( $post_type ) ) {
1178
+			return false;
1179
+	}
1138 1180
 
1139 1181
 	if ( 'post' === $post_type ) {
1140 1182
 		$show_on_front = get_option( 'show_on_front' );
@@ -1149,15 +1191,17 @@  discard block
 block discarded – undo
1149 1191
 		return apply_filters( 'post_type_archive_link', $link, $post_type );
1150 1192
 	}
1151 1193
 
1152
-	if ( ! $post_type_obj->has_archive )
1153
-		return false;
1194
+	if ( ! $post_type_obj->has_archive ) {
1195
+			return false;
1196
+	}
1154 1197
 
1155 1198
 	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
1156 1199
 		$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
1157
-		if ( $post_type_obj->rewrite['with_front'] )
1158
-			$struct = $wp_rewrite->front . $struct;
1159
-		else
1160
-			$struct = $wp_rewrite->root . $struct;
1200
+		if ( $post_type_obj->rewrite['with_front'] ) {
1201
+					$struct = $wp_rewrite->front . $struct;
1202
+		} else {
1203
+					$struct = $wp_rewrite->root . $struct;
1204
+		}
1161 1205
 		$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
1162 1206
 	} else {
1163 1207
 		$link = home_url( '?post_type=' . $post_type );
@@ -1185,18 +1229,21 @@  discard block
 block discarded – undo
1185 1229
  */
1186 1230
 function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
1187 1231
 	$default_feed = get_default_feed();
1188
-	if ( empty( $feed ) )
1189
-		$feed = $default_feed;
1232
+	if ( empty( $feed ) ) {
1233
+			$feed = $default_feed;
1234
+	}
1190 1235
 
1191
-	if ( ! $link = get_post_type_archive_link( $post_type ) )
1192
-		return false;
1236
+	if ( ! $link = get_post_type_archive_link( $post_type ) ) {
1237
+			return false;
1238
+	}
1193 1239
 
1194 1240
 	$post_type_obj = get_post_type_object( $post_type );
1195 1241
 	if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
1196 1242
 		$link = trailingslashit( $link );
1197 1243
 		$link .= 'feed/';
1198
-		if ( $feed != $default_feed )
1199
-			$link .= "$feed/";
1244
+		if ( $feed != $default_feed ) {
1245
+					$link .= "$feed/";
1246
+		}
1200 1247
 	} else {
1201 1248
 		$link = add_query_arg( 'feed', $feed, $link );
1202 1249
 	}
@@ -1268,22 +1315,26 @@  discard block
 block discarded – undo
1268 1315
  *                     not allow an editing UI.
1269 1316
  */
1270 1317
 function get_edit_post_link( $id = 0, $context = 'display' ) {
1271
-	if ( ! $post = get_post( $id ) )
1272
-		return;
1318
+	if ( ! $post = get_post( $id ) ) {
1319
+			return;
1320
+	}
1273 1321
 
1274
-	if ( 'revision' === $post->post_type )
1275
-		$action = '';
1276
-	elseif ( 'display' == $context )
1277
-		$action = '&amp;action=edit';
1278
-	else
1279
-		$action = '&action=edit';
1322
+	if ( 'revision' === $post->post_type ) {
1323
+			$action = '';
1324
+	} elseif ( 'display' == $context ) {
1325
+			$action = '&amp;action=edit';
1326
+	} else {
1327
+			$action = '&action=edit';
1328
+	}
1280 1329
 
1281 1330
 	$post_type_object = get_post_type_object( $post->post_type );
1282
-	if ( !$post_type_object )
1283
-		return;
1331
+	if ( !$post_type_object ) {
1332
+			return;
1333
+	}
1284 1334
 
1285
-	if ( !current_user_can( 'edit_post', $post->ID ) )
1286
-		return;
1335
+	if ( !current_user_can( 'edit_post', $post->ID ) ) {
1336
+			return;
1337
+	}
1287 1338
 
1288 1339
 	if ( $post_type_object->_edit_link ) {
1289 1340
 		$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
@@ -1356,18 +1407,22 @@  discard block
 block discarded – undo
1356 1407
  * @return string|void The delete post link URL for the given post.
1357 1408
  */
1358 1409
 function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {
1359
-	if ( ! empty( $deprecated ) )
1360
-		_deprecated_argument( __FUNCTION__, '3.0.0' );
1410
+	if ( ! empty( $deprecated ) ) {
1411
+			_deprecated_argument( __FUNCTION__, '3.0.0' );
1412
+	}
1361 1413
 
1362
-	if ( !$post = get_post( $id ) )
1363
-		return;
1414
+	if ( !$post = get_post( $id ) ) {
1415
+			return;
1416
+	}
1364 1417
 
1365 1418
 	$post_type_object = get_post_type_object( $post->post_type );
1366
-	if ( !$post_type_object )
1367
-		return;
1419
+	if ( !$post_type_object ) {
1420
+			return;
1421
+	}
1368 1422
 
1369
-	if ( !current_user_can( 'delete_post', $post->ID ) )
1370
-		return;
1423
+	if ( !current_user_can( 'delete_post', $post->ID ) ) {
1424
+			return;
1425
+	}
1371 1426
 
1372 1427
 	$action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
1373 1428
 
@@ -1396,8 +1451,9 @@  discard block
 block discarded – undo
1396 1451
 function get_edit_comment_link( $comment_id = 0 ) {
1397 1452
 	$comment = get_comment( $comment_id );
1398 1453
 
1399
-	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
1400
-		return;
1454
+	if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
1455
+			return;
1456
+	}
1401 1457
 
1402 1458
 	$location = admin_url('comment.php?action=editcomment&amp;c=') . $comment->comment_ID;
1403 1459
 
@@ -1456,8 +1512,9 @@  discard block
 block discarded – undo
1456 1512
 function get_edit_bookmark_link( $link = 0 ) {
1457 1513
 	$link = get_bookmark( $link );
1458 1514
 
1459
-	if ( !current_user_can('manage_links') )
1460
-		return;
1515
+	if ( !current_user_can('manage_links') ) {
1516
+			return;
1517
+	}
1461 1518
 
1462 1519
 	$location = admin_url('link.php?action=edit&amp;link_id=') . $link->link_id;
1463 1520
 
@@ -1485,11 +1542,13 @@  discard block
 block discarded – undo
1485 1542
 function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
1486 1543
 	$bookmark = get_bookmark($bookmark);
1487 1544
 
1488
-	if ( !current_user_can('manage_links') )
1489
-		return;
1545
+	if ( !current_user_can('manage_links') ) {
1546
+			return;
1547
+	}
1490 1548
 
1491
-	if ( empty($link) )
1492
-		$link = __('Edit This');
1549
+	if ( empty($link) ) {
1550
+			$link = __('Edit This');
1551
+	}
1493 1552
 
1494 1553
 	$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';
1495 1554
 
@@ -1513,21 +1572,25 @@  discard block
 block discarded – undo
1513 1572
  * @return string URL to edit user page or empty string.
1514 1573
  */
1515 1574
 function get_edit_user_link( $user_id = null ) {
1516
-	if ( ! $user_id )
1517
-		$user_id = get_current_user_id();
1575
+	if ( ! $user_id ) {
1576
+			$user_id = get_current_user_id();
1577
+	}
1518 1578
 
1519
-	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
1520
-		return '';
1579
+	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {
1580
+			return '';
1581
+	}
1521 1582
 
1522 1583
 	$user = get_userdata( $user_id );
1523 1584
 
1524
-	if ( ! $user )
1525
-		return '';
1585
+	if ( ! $user ) {
1586
+			return '';
1587
+	}
1526 1588
 
1527
-	if ( get_current_user_id() == $user->ID )
1528
-		$link = get_edit_profile_url( $user->ID );
1529
-	else
1530
-		$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
1589
+	if ( get_current_user_id() == $user->ID ) {
1590
+			$link = get_edit_profile_url( $user->ID );
1591
+	} else {
1592
+			$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
1593
+	}
1531 1594
 
1532 1595
 	/**
1533 1596
 	 * Filters the user edit link.
@@ -1591,8 +1654,9 @@  discard block
 block discarded – undo
1591 1654
 function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
1592 1655
 	global $wpdb;
1593 1656
 
1594
-	if ( ( ! $post = get_post() ) || ! taxonomy_exists( $taxonomy ) )
1595
-		return null;
1657
+	if ( ( ! $post = get_post() ) || ! taxonomy_exists( $taxonomy ) ) {
1658
+			return null;
1659
+	}
1596 1660
 
1597 1661
 	$current_post_date = $post->post_date;
1598 1662
 
@@ -1617,16 +1681,18 @@  discard block
 block discarded – undo
1617 1681
 			$join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
1618 1682
 			$where .= $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
1619 1683
 
1620
-			if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) )
1621
-				return '';
1684
+			if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
1685
+							return '';
1686
+			}
1622 1687
 			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
1623 1688
 
1624 1689
 			// Remove any exclusions from the term array to include.
1625 1690
 			$term_array = array_diff( $term_array, (array) $excluded_terms );
1626 1691
 			$term_array = array_map( 'intval', $term_array );
1627 1692
 
1628
-			if ( ! $term_array || is_wp_error( $term_array ) )
1629
-				return '';
1693
+			if ( ! $term_array || is_wp_error( $term_array ) ) {
1694
+							return '';
1695
+			}
1630 1696
 
1631 1697
 			$where .= " AND tt.term_id IN (" . implode( ',', $term_array ) . ")";
1632 1698
 		}
@@ -1733,19 +1799,22 @@  discard block
 block discarded – undo
1733 1799
 	$query_key = 'adjacent_post_' . md5( $query );
1734 1800
 	$result = wp_cache_get( $query_key, 'counts' );
1735 1801
 	if ( false !== $result ) {
1736
-		if ( $result )
1737
-			$result = get_post( $result );
1802
+		if ( $result ) {
1803
+					$result = get_post( $result );
1804
+		}
1738 1805
 		return $result;
1739 1806
 	}
1740 1807
 
1741 1808
 	$result = $wpdb->get_var( $query );
1742
-	if ( null === $result )
1743
-		$result = '';
1809
+	if ( null === $result ) {
1810
+			$result = '';
1811
+	}
1744 1812
 
1745 1813
 	wp_cache_set( $query_key, $result, 'counts' );
1746 1814
 
1747
-	if ( $result )
1748
-		$result = get_post( $result );
1815
+	if ( $result ) {
1816
+			$result = get_post( $result );
1817
+	}
1749 1818
 
1750 1819
 	return $result;
1751 1820
 }
@@ -1765,18 +1834,21 @@  discard block
 block discarded – undo
1765 1834
  * @return string|void The adjacent post relational link URL.
1766 1835
  */
1767 1836
 function get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
1768
-	if ( $previous && is_attachment() && $post = get_post() )
1769
-		$post = get_post( $post->post_parent );
1770
-	else
1771
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
1837
+	if ( $previous && is_attachment() && $post = get_post() ) {
1838
+			$post = get_post( $post->post_parent );
1839
+	} else {
1840
+			$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
1841
+	}
1772 1842
 
1773
-	if ( empty( $post ) )
1774
-		return;
1843
+	if ( empty( $post ) ) {
1844
+			return;
1845
+	}
1775 1846
 
1776 1847
 	$post_title = the_title_attribute( array( 'echo' => false, 'post' => $post ) );
1777 1848
 
1778
-	if ( empty( $post_title ) )
1779
-		$post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
1849
+	if ( empty( $post_title ) ) {
1850
+			$post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
1851
+	}
1780 1852
 
1781 1853
 	$date = mysql2date( get_option( 'date_format' ), $post->post_date );
1782 1854
 
@@ -1884,8 +1956,9 @@  discard block
 block discarded – undo
1884 1956
  */
1885 1957
 function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) {
1886 1958
 	$post = get_post();
1887
-	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) )
1888
-		return null;
1959
+	if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) ) {
1960
+			return null;
1961
+	}
1889 1962
 
1890 1963
 	$query_args = array(
1891 1964
 		'posts_per_page' => 1,
@@ -1897,23 +1970,26 @@  discard block
 block discarded – undo
1897 1970
 	$term_array = array();
1898 1971
 
1899 1972
 	if ( ! is_array( $excluded_terms ) ) {
1900
-		if ( ! empty( $excluded_terms ) )
1901
-			$excluded_terms = explode( ',', $excluded_terms );
1902
-		else
1903
-			$excluded_terms = array();
1973
+		if ( ! empty( $excluded_terms ) ) {
1974
+					$excluded_terms = explode( ',', $excluded_terms );
1975
+		} else {
1976
+					$excluded_terms = array();
1977
+		}
1904 1978
 	}
1905 1979
 
1906 1980
 	if ( $in_same_term || ! empty( $excluded_terms ) ) {
1907
-		if ( $in_same_term )
1908
-			$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
1981
+		if ( $in_same_term ) {
1982
+					$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
1983
+		}
1909 1984
 
1910 1985
 		if ( ! empty( $excluded_terms ) ) {
1911 1986
 			$excluded_terms = array_map( 'intval', $excluded_terms );
1912 1987
 			$excluded_terms = array_diff( $excluded_terms, $term_array );
1913 1988
 
1914 1989
 			$inverse_terms = array();
1915
-			foreach ( $excluded_terms as $excluded_term )
1916
-				$inverse_terms[] = $excluded_term * -1;
1990
+			foreach ( $excluded_terms as $excluded_term ) {
1991
+							$inverse_terms[] = $excluded_term * -1;
1992
+			}
1917 1993
 			$excluded_terms = $inverse_terms;
1918 1994
 		}
1919 1995
 
@@ -2007,18 +2083,20 @@  discard block
 block discarded – undo
2007 2083
  * @return string The link URL of the previous or next post in relation to the current post.
2008 2084
  */
2009 2085
 function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
2010
-	if ( $previous && is_attachment() )
2011
-		$post = get_post( get_post()->post_parent );
2012
-	else
2013
-		$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
2086
+	if ( $previous && is_attachment() ) {
2087
+			$post = get_post( get_post()->post_parent );
2088
+	} else {
2089
+			$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
2090
+	}
2014 2091
 
2015 2092
 	if ( ! $post ) {
2016 2093
 		$output = '';
2017 2094
 	} else {
2018 2095
 		$title = $post->post_title;
2019 2096
 
2020
-		if ( empty( $post->post_title ) )
2021
-			$title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
2097
+		if ( empty( $post->post_title ) ) {
2098
+					$title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );
2099
+		}
2022 2100
 
2023 2101
 		/** This filter is documented in wp-includes/post-template.php */
2024 2102
 		$title = apply_filters( 'the_title', $title, $post->ID );
@@ -2123,8 +2201,9 @@  discard block
 block discarded – undo
2123 2201
 
2124 2202
 		$base = trailingslashit( get_bloginfo( 'url' ) );
2125 2203
 
2126
-		if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
2127
-			$base .= $wp_rewrite->index . '/';
2204
+		if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) {
2205
+					$base .= $wp_rewrite->index . '/';
2206
+		}
2128 2207
 
2129 2208
 		if ( $pagenum > 1 ) {
2130 2209
 			$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
@@ -2142,11 +2221,12 @@  discard block
 block discarded – undo
2142 2221
 	 */
2143 2222
 	$result = apply_filters( 'get_pagenum_link', $result );
2144 2223
 
2145
-	if ( $escape )
2146
-		return esc_url( $result );
2147
-	else
2148
-		return esc_url_raw( $result );
2149
-}
2224
+	if ( $escape ) {
2225
+			return esc_url( $result );
2226
+	} else {
2227
+			return esc_url_raw( $result );
2228
+	}
2229
+	}
2150 2230
 
2151 2231
 /**
2152 2232
  * Retrieves the next posts page link.
@@ -2164,11 +2244,13 @@  discard block
 block discarded – undo
2164 2244
 	global $paged;
2165 2245
 
2166 2246
 	if ( !is_single() ) {
2167
-		if ( !$paged )
2168
-			$paged = 1;
2247
+		if ( !$paged ) {
2248
+					$paged = 1;
2249
+		}
2169 2250
 		$nextpage = intval($paged) + 1;
2170
-		if ( !$max_page || $max_page >= $nextpage )
2171
-			return get_pagenum_link($nextpage);
2251
+		if ( !$max_page || $max_page >= $nextpage ) {
2252
+					return get_pagenum_link($nextpage);
2253
+		}
2172 2254
 	}
2173 2255
 }
2174 2256
 
@@ -2184,11 +2266,12 @@  discard block
 block discarded – undo
2184 2266
 function next_posts( $max_page = 0, $echo = true ) {
2185 2267
 	$output = esc_url( get_next_posts_page_link( $max_page ) );
2186 2268
 
2187
-	if ( $echo )
2188
-		echo $output;
2189
-	else
2190
-		return $output;
2191
-}
2269
+	if ( $echo ) {
2270
+			echo $output;
2271
+	} else {
2272
+			return $output;
2273
+	}
2274
+	}
2192 2275
 
2193 2276
 /**
2194 2277
  * Retrieves the next posts page link.
@@ -2205,16 +2288,19 @@  discard block
 block discarded – undo
2205 2288
 function get_next_posts_link( $label = null, $max_page = 0 ) {
2206 2289
 	global $paged, $wp_query;
2207 2290
 
2208
-	if ( !$max_page )
2209
-		$max_page = $wp_query->max_num_pages;
2291
+	if ( !$max_page ) {
2292
+			$max_page = $wp_query->max_num_pages;
2293
+	}
2210 2294
 
2211
-	if ( !$paged )
2212
-		$paged = 1;
2295
+	if ( !$paged ) {
2296
+			$paged = 1;
2297
+	}
2213 2298
 
2214 2299
 	$nextpage = intval($paged) + 1;
2215 2300
 
2216
-	if ( null === $label )
2217
-		$label = __( 'Next Page &raquo;' );
2301
+	if ( null === $label ) {
2302
+			$label = __( 'Next Page &raquo;' );
2303
+	}
2218 2304
 
2219 2305
 	if ( !is_single() && ( $nextpage <= $max_page ) ) {
2220 2306
 		/**
@@ -2260,8 +2346,9 @@  discard block
 block discarded – undo
2260 2346
 
2261 2347
 	if ( !is_single() ) {
2262 2348
 		$nextpage = intval($paged) - 1;
2263
-		if ( $nextpage < 1 )
2264
-			$nextpage = 1;
2349
+		if ( $nextpage < 1 ) {
2350
+					$nextpage = 1;
2351
+		}
2265 2352
 		return get_pagenum_link($nextpage);
2266 2353
 	}
2267 2354
 }
@@ -2277,11 +2364,12 @@  discard block
 block discarded – undo
2277 2364
 function previous_posts( $echo = true ) {
2278 2365
 	$output = esc_url( get_previous_posts_page_link() );
2279 2366
 
2280
-	if ( $echo )
2281
-		echo $output;
2282
-	else
2283
-		return $output;
2284
-}
2367
+	if ( $echo ) {
2368
+			echo $output;
2369
+	} else {
2370
+			return $output;
2371
+	}
2372
+	}
2285 2373
 
2286 2374
 /**
2287 2375
  * Retrieves the previous posts page link.
@@ -2296,8 +2384,9 @@  discard block
 block discarded – undo
2296 2384
 function get_previous_posts_link( $label = null ) {
2297 2385
 	global $paged;
2298 2386
 
2299
-	if ( null === $label )
2300
-		$label = __( '&laquo; Previous Page' );
2387
+	if ( null === $label ) {
2388
+			$label = __( '&laquo; Previous Page' );
2389
+	}
2301 2390
 
2302 2391
 	if ( !is_single() && $paged > 1 ) {
2303 2392
 		/**
@@ -2629,16 +2718,18 @@  discard block
 block discarded – undo
2629 2718
 
2630 2719
 	if ( 'newest' == get_option('default_comments_page') ) {
2631 2720
 		if ( $pagenum != $max_page ) {
2632
-			if ( $wp_rewrite->using_permalinks() )
2633
-				$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2634
-			else
2635
-				$result = add_query_arg( 'cpage', $pagenum, $result );
2721
+			if ( $wp_rewrite->using_permalinks() ) {
2722
+							$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2723
+			} else {
2724
+							$result = add_query_arg( 'cpage', $pagenum, $result );
2725
+			}
2636 2726
 		}
2637 2727
 	} elseif ( $pagenum > 1 ) {
2638
-		if ( $wp_rewrite->using_permalinks() )
2639
-			$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2640
-		else
2641
-			$result = add_query_arg( 'cpage', $pagenum, $result );
2728
+		if ( $wp_rewrite->using_permalinks() ) {
2729
+					$result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged');
2730
+		} else {
2731
+					$result = add_query_arg( 'cpage', $pagenum, $result );
2732
+		}
2642 2733
 	}
2643 2734
 
2644 2735
 	$result .= '#comments';
@@ -2667,8 +2758,9 @@  discard block
 block discarded – undo
2667 2758
 function get_next_comments_link( $label = '', $max_page = 0 ) {
2668 2759
 	global $wp_query;
2669 2760
 
2670
-	if ( ! is_singular() )
2671
-		return;
2761
+	if ( ! is_singular() ) {
2762
+			return;
2763
+	}
2672 2764
 
2673 2765
 	$page = get_query_var('cpage');
2674 2766
 
@@ -2678,17 +2770,21 @@  discard block
 block discarded – undo
2678 2770
 
2679 2771
 	$nextpage = intval($page) + 1;
2680 2772
 
2681
-	if ( empty($max_page) )
2682
-		$max_page = $wp_query->max_num_comment_pages;
2773
+	if ( empty($max_page) ) {
2774
+			$max_page = $wp_query->max_num_comment_pages;
2775
+	}
2683 2776
 
2684
-	if ( empty($max_page) )
2685
-		$max_page = get_comment_pages_count();
2777
+	if ( empty($max_page) ) {
2778
+			$max_page = get_comment_pages_count();
2779
+	}
2686 2780
 
2687
-	if ( $nextpage > $max_page )
2688
-		return;
2781
+	if ( $nextpage > $max_page ) {
2782
+			return;
2783
+	}
2689 2784
 
2690
-	if ( empty($label) )
2691
-		$label = __('Newer Comments &raquo;');
2785
+	if ( empty($label) ) {
2786
+			$label = __('Newer Comments &raquo;');
2787
+	}
2692 2788
 
2693 2789
 	/**
2694 2790
 	 * Filters the anchor tag attributes for the next comments page link.
@@ -2721,18 +2817,21 @@  discard block
 block discarded – undo
2721 2817
  * @return string|void HTML-formatted link for the previous page of comments.
2722 2818
  */
2723 2819
 function get_previous_comments_link( $label = '' ) {
2724
-	if ( ! is_singular() )
2725
-		return;
2820
+	if ( ! is_singular() ) {
2821
+			return;
2822
+	}
2726 2823
 
2727 2824
 	$page = get_query_var('cpage');
2728 2825
 
2729
-	if ( intval($page) <= 1 )
2730
-		return;
2826
+	if ( intval($page) <= 1 ) {
2827
+			return;
2828
+	}
2731 2829
 
2732 2830
 	$prevpage = intval($page) - 1;
2733 2831
 
2734
-	if ( empty($label) )
2735
-		$label = __('&laquo; Older Comments');
2832
+	if ( empty($label) ) {
2833
+			$label = __('&laquo; Older Comments');
2834
+	}
2736 2835
 
2737 2836
 	/**
2738 2837
 	 * Filters the anchor tag attributes for the previous comments page link.
@@ -2769,12 +2868,14 @@  discard block
 block discarded – undo
2769 2868
 function paginate_comments_links( $args = array() ) {
2770 2869
 	global $wp_rewrite;
2771 2870
 
2772
-	if ( ! is_singular() )
2773
-		return;
2871
+	if ( ! is_singular() ) {
2872
+			return;
2873
+	}
2774 2874
 
2775 2875
 	$page = get_query_var('cpage');
2776
-	if ( !$page )
2777
-		$page = 1;
2876
+	if ( !$page ) {
2877
+			$page = 1;
2878
+	}
2778 2879
 	$max_page = get_comment_pages_count();
2779 2880
 	$defaults = array(
2780 2881
 		'base' => add_query_arg( 'cpage', '%#%' ),
@@ -2784,17 +2885,19 @@  discard block
 block discarded – undo
2784 2885
 		'echo' => true,
2785 2886
 		'add_fragment' => '#comments'
2786 2887
 	);
2787
-	if ( $wp_rewrite->using_permalinks() )
2788
-		$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
2888
+	if ( $wp_rewrite->using_permalinks() ) {
2889
+			$defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged');
2890
+	}
2789 2891
 
2790 2892
 	$args = wp_parse_args( $args, $defaults );
2791 2893
 	$page_links = paginate_links( $args );
2792 2894
 
2793
-	if ( $args['echo'] )
2794
-		echo $page_links;
2795
-	else
2796
-		return $page_links;
2797
-}
2895
+	if ( $args['echo'] ) {
2896
+			echo $page_links;
2897
+	} else {
2898
+			return $page_links;
2899
+	}
2900
+	}
2798 2901
 
2799 2902
 /**
2800 2903
  * Retrieves navigation to next/previous set of comments, when applicable.
@@ -3000,16 +3103,18 @@  discard block
 block discarded – undo
3000 3103
 	}
3001 3104
 
3002 3105
 	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
3003
-		if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow )
3004
-			$scheme = 'https';
3005
-		else
3006
-			$scheme = parse_url( $url, PHP_URL_SCHEME );
3106
+		if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {
3107
+					$scheme = 'https';
3108
+		} else {
3109
+					$scheme = parse_url( $url, PHP_URL_SCHEME );
3110
+		}
3007 3111
 	}
3008 3112
 
3009 3113
 	$url = set_url_scheme( $url, $scheme );
3010 3114
 
3011
-	if ( $path && is_string( $path ) )
3012
-		$url .= '/' . ltrim( $path, '/' );
3115
+	if ( $path && is_string( $path ) ) {
3116
+			$url .= '/' . ltrim( $path, '/' );
3117
+	}
3013 3118
 
3014 3119
 	/**
3015 3120
 	 * Filters the home URL.
@@ -3071,8 +3176,9 @@  discard block
 block discarded – undo
3071 3176
 
3072 3177
 	$url = set_url_scheme( $url, $scheme );
3073 3178
 
3074
-	if ( $path && is_string( $path ) )
3075
-		$url .= '/' . ltrim( $path, '/' );
3179
+	if ( $path && is_string( $path ) ) {
3180
+			$url .= '/' . ltrim( $path, '/' );
3181
+	}
3076 3182
 
3077 3183
 	/**
3078 3184
 	 * Filters the site URL.
@@ -3117,8 +3223,9 @@  discard block
 block discarded – undo
3117 3223
 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
3118 3224
 	$url = get_site_url($blog_id, 'wp-admin/', $scheme);
3119 3225
 
3120
-	if ( $path && is_string( $path ) )
3121
-		$url .= ltrim( $path, '/' );
3226
+	if ( $path && is_string( $path ) ) {
3227
+			$url .= ltrim( $path, '/' );
3228
+	}
3122 3229
 
3123 3230
 	/**
3124 3231
 	 * Filters the admin area URL.
@@ -3145,8 +3252,9 @@  discard block
 block discarded – undo
3145 3252
 function includes_url( $path = '', $scheme = null ) {
3146 3253
 	$url = site_url( '/' . WPINC . '/', $scheme );
3147 3254
 
3148
-	if ( $path && is_string( $path ) )
3149
-		$url .= ltrim($path, '/');
3255
+	if ( $path && is_string( $path ) ) {
3256
+			$url .= ltrim($path, '/');
3257
+	}
3150 3258
 
3151 3259
 	/**
3152 3260
 	 * Filters the URL to the includes directory.
@@ -3171,8 +3279,9 @@  discard block
 block discarded – undo
3171 3279
 function content_url( $path = '' ) {
3172 3280
 	$url = set_url_scheme( WP_CONTENT_URL );
3173 3281
 
3174
-	if ( $path && is_string( $path ) )
3175
-		$url .= '/' . ltrim($path, '/');
3282
+	if ( $path && is_string( $path ) ) {
3283
+			$url .= '/' . ltrim($path, '/');
3284
+	}
3176 3285
 
3177 3286
 	/**
3178 3287
 	 * Filters the URL to the content directory.
@@ -3206,22 +3315,25 @@  discard block
 block discarded – undo
3206 3315
 	$plugin = wp_normalize_path( $plugin );
3207 3316
 	$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
3208 3317
 
3209
-	if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) )
3210
-		$url = WPMU_PLUGIN_URL;
3211
-	else
3212
-		$url = WP_PLUGIN_URL;
3318
+	if ( !empty($plugin) && 0 === strpos($plugin, $mu_plugin_dir) ) {
3319
+			$url = WPMU_PLUGIN_URL;
3320
+	} else {
3321
+			$url = WP_PLUGIN_URL;
3322
+	}
3213 3323
 
3214 3324
 
3215 3325
 	$url = set_url_scheme( $url );
3216 3326
 
3217 3327
 	if ( !empty($plugin) && is_string($plugin) ) {
3218 3328
 		$folder = dirname(plugin_basename($plugin));
3219
-		if ( '.' != $folder )
3220
-			$url .= '/' . ltrim($folder, '/');
3329
+		if ( '.' != $folder ) {
3330
+					$url .= '/' . ltrim($folder, '/');
3331
+		}
3221 3332
 	}
3222 3333
 
3223
-	if ( $path && is_string( $path ) )
3224
-		$url .= '/' . ltrim($path, '/');
3334
+	if ( $path && is_string( $path ) ) {
3335
+			$url .= '/' . ltrim($path, '/');
3336
+	}
3225 3337
 
3226 3338
 	/**
3227 3339
 	 * Filters the URL to the plugins directory.
@@ -3254,18 +3366,21 @@  discard block
 block discarded – undo
3254 3366
  * @return string Site URL link with optional path appended.
3255 3367
  */
3256 3368
 function network_site_url( $path = '', $scheme = null ) {
3257
-	if ( ! is_multisite() )
3258
-		return site_url($path, $scheme);
3369
+	if ( ! is_multisite() ) {
3370
+			return site_url($path, $scheme);
3371
+	}
3259 3372
 
3260 3373
 	$current_network = get_network();
3261 3374
 
3262
-	if ( 'relative' == $scheme )
3263
-		$url = $current_network->path;
3264
-	else
3265
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3375
+	if ( 'relative' == $scheme ) {
3376
+			$url = $current_network->path;
3377
+	} else {
3378
+			$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3379
+	}
3266 3380
 
3267
-	if ( $path && is_string( $path ) )
3268
-		$url .= ltrim( $path, '/' );
3381
+	if ( $path && is_string( $path ) ) {
3382
+			$url .= ltrim( $path, '/' );
3383
+	}
3269 3384
 
3270 3385
 	/**
3271 3386
 	 * Filters the network site URL.
@@ -3296,22 +3411,26 @@  discard block
 block discarded – undo
3296 3411
  * @return string Home URL link with optional path appended.
3297 3412
  */
3298 3413
 function network_home_url( $path = '', $scheme = null ) {
3299
-	if ( ! is_multisite() )
3300
-		return home_url($path, $scheme);
3414
+	if ( ! is_multisite() ) {
3415
+			return home_url($path, $scheme);
3416
+	}
3301 3417
 
3302 3418
 	$current_network = get_network();
3303 3419
 	$orig_scheme = $scheme;
3304 3420
 
3305
-	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
3306
-		$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
3421
+	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
3422
+			$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
3423
+	}
3307 3424
 
3308
-	if ( 'relative' == $scheme )
3309
-		$url = $current_network->path;
3310
-	else
3311
-		$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3425
+	if ( 'relative' == $scheme ) {
3426
+			$url = $current_network->path;
3427
+	} else {
3428
+			$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
3429
+	}
3312 3430
 
3313
-	if ( $path && is_string( $path ) )
3314
-		$url .= ltrim( $path, '/' );
3431
+	if ( $path && is_string( $path ) ) {
3432
+			$url .= ltrim( $path, '/' );
3433
+	}
3315 3434
 
3316 3435
 	/**
3317 3436
 	 * Filters the network home URL.
@@ -3338,13 +3457,15 @@  discard block
 block discarded – undo
3338 3457
  * @return string Admin URL link with optional path appended.
3339 3458
  */
3340 3459
 function network_admin_url( $path = '', $scheme = 'admin' ) {
3341
-	if ( ! is_multisite() )
3342
-		return admin_url( $path, $scheme );
3460
+	if ( ! is_multisite() ) {
3461
+			return admin_url( $path, $scheme );
3462
+	}
3343 3463
 
3344 3464
 	$url = network_site_url('wp-admin/network/', $scheme);
3345 3465
 
3346
-	if ( $path && is_string( $path ) )
3347
-		$url .= ltrim($path, '/');
3466
+	if ( $path && is_string( $path ) ) {
3467
+			$url .= ltrim($path, '/');
3468
+	}
3348 3469
 
3349 3470
 	/**
3350 3471
 	 * Filters the network admin URL.
@@ -3371,8 +3492,9 @@  discard block
 block discarded – undo
3371 3492
 function user_admin_url( $path = '', $scheme = 'admin' ) {
3372 3493
 	$url = network_site_url('wp-admin/user/', $scheme);
3373 3494
 
3374
-	if ( $path && is_string( $path ) )
3375
-		$url .= ltrim($path, '/');
3495
+	if ( $path && is_string( $path ) ) {
3496
+			$url .= ltrim($path, '/');
3497
+	}
3376 3498
 
3377 3499
 	/**
3378 3500
 	 * Filters the user admin URL for the current user.
@@ -3397,13 +3519,14 @@  discard block
 block discarded – undo
3397 3519
  * @return string Admin URL link with optional path appended.
3398 3520
  */
3399 3521
 function self_admin_url( $path = '', $scheme = 'admin' ) {
3400
-	if ( is_network_admin() )
3401
-		return network_admin_url($path, $scheme);
3402
-	elseif ( is_user_admin() )
3403
-		return user_admin_url($path, $scheme);
3404
-	else
3405
-		return admin_url($path, $scheme);
3406
-}
3522
+	if ( is_network_admin() ) {
3523
+			return network_admin_url($path, $scheme);
3524
+	} elseif ( is_user_admin() ) {
3525
+			return user_admin_url($path, $scheme);
3526
+	} else {
3527
+			return admin_url($path, $scheme);
3528
+	}
3529
+	}
3407 3530
 
3408 3531
 /**
3409 3532
  * Sets the scheme for a URL.
@@ -3428,13 +3551,15 @@  discard block
 block discarded – undo
3428 3551
 	}
3429 3552
 
3430 3553
 	$url = trim( $url );
3431
-	if ( substr( $url, 0, 2 ) === '//' )
3432
-		$url = 'http:' . $url;
3554
+	if ( substr( $url, 0, 2 ) === '//' ) {
3555
+			$url = 'http:' . $url;
3556
+	}
3433 3557
 
3434 3558
 	if ( 'relative' == $scheme ) {
3435 3559
 		$url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) );
3436
-		if ( $url !== '' && $url[0] === '/' )
3437
-			$url = '/' . ltrim($url , "/ \t\n\r\0\x0B" );
3560
+		if ( $url !== '' && $url[0] === '/' ) {
3561
+					$url = '/' . ltrim($url , "/ \t\n\r\0\x0B" );
3562
+		}
3438 3563
 	} else {
3439 3564
 		$url = preg_replace( '#^\w+://#', $scheme . '://', $url );
3440 3565
 	}
@@ -3482,10 +3607,11 @@  discard block
 block discarded – undo
3482 3607
 			$url = admin_url( $path, $scheme );
3483 3608
 		} else {
3484 3609
 			$active = get_active_blog_for_user( $user_id );
3485
-			if ( $active )
3486
-				$url = get_admin_url( $active->blog_id, $path, $scheme );
3487
-			else
3488
-				$url = user_admin_url( $path, $scheme );
3610
+			if ( $active ) {
3611
+							$url = get_admin_url( $active->blog_id, $path, $scheme );
3612
+			} else {
3613
+							$url = user_admin_url( $path, $scheme );
3614
+			}
3489 3615
 		}
3490 3616
 	}
3491 3617
 
@@ -3516,12 +3642,13 @@  discard block
 block discarded – undo
3516 3642
 function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
3517 3643
 	$user_id = $user_id ? (int) $user_id : get_current_user_id();
3518 3644
 
3519
-	if ( is_user_admin() )
3520
-		$url = user_admin_url( 'profile.php', $scheme );
3521
-	elseif ( is_network_admin() )
3522
-		$url = network_admin_url( 'profile.php', $scheme );
3523
-	else
3524
-		$url = get_dashboard_url( $user_id, 'profile.php', $scheme );
3645
+	if ( is_user_admin() ) {
3646
+			$url = user_admin_url( 'profile.php', $scheme );
3647
+	} elseif ( is_network_admin() ) {
3648
+			$url = network_admin_url( 'profile.php', $scheme );
3649
+	} else {
3650
+			$url = get_dashboard_url( $user_id, 'profile.php', $scheme );
3651
+	}
3525 3652
 
3526 3653
 	/**
3527 3654
 	 * Filters the URL for a user's profile editor.
@@ -3659,8 +3786,9 @@  discard block
 block discarded – undo
3659 3786
 		$post = get_post( $post_id );
3660 3787
 	} elseif ( 'post' == $context ) {
3661 3788
 		$post = get_post( $id );
3662
-		if ( ! empty( $post->ID ) )
3663
-			$post_id = $post->ID;
3789
+		if ( ! empty( $post->ID ) ) {
3790
+					$post_id = $post->ID;
3791
+		}
3664 3792
 	}
3665 3793
 
3666 3794
 	$shortlink = '';
@@ -3699,8 +3827,9 @@  discard block
 block discarded – undo
3699 3827
 function wp_shortlink_wp_head() {
3700 3828
 	$shortlink = wp_get_shortlink( 0, 'query' );
3701 3829
 
3702
-	if ( empty( $shortlink ) )
3703
-		return;
3830
+	if ( empty( $shortlink ) ) {
3831
+			return;
3832
+	}
3704 3833
 
3705 3834
 	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
3706 3835
 }
@@ -3713,13 +3842,15 @@  discard block
 block discarded – undo
3713 3842
  * @since 3.0.0
3714 3843
  */
3715 3844
 function wp_shortlink_header() {
3716
-	if ( headers_sent() )
3717
-		return;
3845
+	if ( headers_sent() ) {
3846
+			return;
3847
+	}
3718 3848
 
3719 3849
 	$shortlink = wp_get_shortlink(0, 'query');
3720 3850
 
3721
-	if ( empty($shortlink) )
3722
-		return;
3851
+	if ( empty($shortlink) ) {
3852
+			return;
3853
+	}
3723 3854
 
3724 3855
 	header('Link: <' . $shortlink . '>; rel=shortlink', false);
3725 3856
 }
@@ -3741,11 +3872,13 @@  discard block
 block discarded – undo
3741 3872
 function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
3742 3873
 	$post = get_post();
3743 3874
 
3744
-	if ( empty( $text ) )
3745
-		$text = __('This is the short link.');
3875
+	if ( empty( $text ) ) {
3876
+			$text = __('This is the short link.');
3877
+	}
3746 3878
 
3747
-	if ( empty( $title ) )
3748
-		$title = the_title_attribute( array( 'echo' => false ) );
3879
+	if ( empty( $title ) ) {
3880
+			$title = the_title_attribute( array( 'echo' => false ) );
3881
+	}
3749 3882
 
3750 3883
 	$shortlink = wp_get_shortlink( $post->ID );
3751 3884
 
Please login to merge, or discard this patch.