Completed
Push — master ( d99bf9...491baf )
by Stephen
13:47
created
tools/i18n/pot-ext-meta.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 		$po = new PO;
39 39
 		foreach($this->headers as $header) {
40 40
 			$string = $makepot->get_addon_header($header, $source);
41
-			if (!$string) continue;
41
+			if (!$string) {
42
+				continue;
43
+			}
42 44
 			$args = array(
43 45
 				'singular' => $string,
44 46
 				'extracted_comments' => $header.' of the plugin/theme',
@@ -50,17 +52,22 @@  discard block
 block discarded – undo
50 52
 	}
51 53
 
52 54
 	function append( $ext_filename, $pot_filename, $headers = null ) {
53
-		if ( $headers )
54
-			$this->headers = (array) $headers;
55
+		if ( $headers ) {
56
+					$this->headers = (array) $headers;
57
+		}
55 58
 		if ( is_dir( $ext_filename ) ) {
56 59
 			$pot = implode('', array_map(array($this, 'load_from_file'), glob("$ext_filename/*.php")));
57 60
 		} else {
58 61
 			$pot = $this->load_from_file($ext_filename);
59 62
 		}
60 63
 		$potf = '-' == $pot_filename? STDOUT : fopen($pot_filename, 'a');
61
-		if (!$potf) return false;
64
+		if (!$potf) {
65
+			return false;
66
+		}
62 67
 		fwrite($potf, $pot);
63
-		if ('-' != $pot_filename) fclose($potf);
68
+		if ('-' != $pot_filename) {
69
+			fclose($potf);
70
+		}
64 71
 		return true;
65 72
 	}
66 73
 }
Please login to merge, or discard this patch.
tools/i18n/t/data/not-gettexted-0-result.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,11 @@
 block discarded – undo
2 2
 
3 3
 if (! isset($wp_did_header)):
4 4
 if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
5
-	if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
6
-	else $path = 'wp-admin/';
5
+	if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) {
6
+		$path = '';
7
+	} else {
8
+		$path = 'wp-admin/';
9
+	}
7 10
 
8 11
 	require_once( dirname(__FILE__) . '/wp-includes/classes.php');
9 12
 	require_once( dirname(__FILE__) . '/wp-includes/functions.php');
Please login to merge, or discard this patch.
tools/i18n/extract.php 1 patch
Braces   +29 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 		$translations = new Translations;
27 27
 		$file_names = (array) scandir( '.' );
28 28
 		foreach ( $file_names as $file_name ) {
29
-			if ( '.' == $file_name || '..' == $file_name ) continue;
29
+			if ( '.' == $file_name || '..' == $file_name ) {
30
+				continue;
31
+			}
30 32
 			if ( preg_match( '/\.php$/', $file_name ) && $this->does_file_name_match( $prefix . $file_name, $excludes, $includes ) ) {
31 33
 				$extracted = $this->extract_from_file( $file_name, $prefix );
32 34
 				$translations->merge_originals_with( $extracted );
@@ -54,7 +56,9 @@  discard block
 block discarded – undo
54 56
 					break;
55 57
 				}
56 58
 			}
57
-			if ( !$matched_any_include ) return false;
59
+			if ( !$matched_any_include ) {
60
+				return false;
61
+			}
58 62
 		}
59 63
 		if ( $excludes ) {
60 64
 			foreach( $excludes as $exclude ) {
@@ -68,12 +72,16 @@  discard block
 block discarded – undo
68 72
 
69 73
 	function entry_from_call( $call, $file_name ) {
70 74
 		$rule = isset( $this->rules[$call['name']] )? $this->rules[$call['name']] : null;
71
-		if ( !$rule ) return null;
75
+		if ( !$rule ) {
76
+			return null;
77
+		}
72 78
 		$entry = new Translation_Entry;
73 79
 		$multiple = array();
74 80
 		$complete = false;
75 81
 		for( $i = 0; $i < count( $rule ); ++$i ) {
76
-			if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) return false;
82
+			if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) {
83
+				return false;
84
+			}
77 85
 			switch( $rule[$i] ) {
78 86
 			case 'string':
79 87
 				if ( $complete ) {
@@ -133,11 +141,12 @@  discard block
 block discarded – undo
133 141
 		$function_calls = $this->find_function_calls( array_keys( $this->rules ), $code );
134 142
 		foreach( $function_calls as $call ) {
135 143
 			$entry = $this->entry_from_call( $call, $file_name );
136
-			if ( is_array( $entry ) )
137
-				foreach( $entry as $single_entry )
144
+			if ( is_array( $entry ) ) {
145
+							foreach( $entry as $single_entry )
138 146
 					$translations->add_entry_or_merge( $single_entry );
139
-			elseif ( $entry)
140
-				$translations->add_entry_or_merge( $entry );
147
+			} elseif ( $entry) {
148
+							$translations->add_entry_or_merge( $entry );
149
+			}
141 150
 		}
142 151
 		return $translations;
143 152
 	}
@@ -155,8 +164,12 @@  discard block
 block discarded – undo
155 164
 		$in_func = false;
156 165
 		foreach( $tokens as $token ) {
157 166
 			$id = $text = null;
158
-			if ( is_array( $token ) ) list( $id, $text, $line ) = $token;
159
-			if ( T_WHITESPACE == $id ) continue;
167
+			if ( is_array( $token ) ) {
168
+				list( $id, $text, $line ) = $token;
169
+			}
170
+			if ( T_WHITESPACE == $id ) {
171
+				continue;
172
+			}
160 173
 			if ( T_STRING == $id && in_array( $text, $function_names ) && !$in_func ) {
161 174
 				$in_func = true;
162 175
 				$paren_level = -1;
@@ -177,7 +190,9 @@  discard block
 block discarded – undo
177 190
 					$latest_comment = $text;
178 191
 				}
179 192
 			}
180
-			if ( !$in_func ) continue;
193
+			if ( !$in_func ) {
194
+				continue;
195
+			}
181 196
 			if ( '(' == $token ) {
182 197
 				$paren_level++;
183 198
 				if ( 0 == $paren_level ) { // start of first argument
@@ -197,7 +212,9 @@  discard block
 block discarded – undo
197 212
 					$in_func = false;
198 213
 					$args[] = $current_argument;
199 214
 					$call = array( 'name' => $func_name, 'args' => $args, 'line' => $func_line );
200
-					if ( $func_comment ) $call['comment'] = $func_comment;
215
+					if ( $func_comment ) {
216
+						$call['comment'] = $func_comment;
217
+					}
201 218
 					$function_calls[] = $call;
202 219
 				}
203 220
 				$paren_level--;
Please login to merge, or discard this patch.
src/wp-cron.php 1 patch
Braces   +22 added lines, -13 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@  discard block
 block discarded – undo
11 11
 
12 12
 ignore_user_abort(true);
13 13
 
14
-if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
14
+if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') ) {
15 15
 	die();
16
+}
16 17
 
17 18
 /**
18 19
  * Tell WordPress we are doing the CRON task.
@@ -48,21 +49,24 @@  discard block
 block discarded – undo
48 49
 		$value = wp_cache_get( 'doing_cron', 'transient', true );
49 50
 	} else {
50 51
 		$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
51
-		if ( is_object( $row ) )
52
-			$value = $row->option_value;
52
+		if ( is_object( $row ) ) {
53
+					$value = $row->option_value;
54
+		}
53 55
 	}
54 56
 
55 57
 	return $value;
56 58
 }
57 59
 
58
-if ( false === $crons = _get_cron_array() )
60
+if ( false === $crons = _get_cron_array() ) {
59 61
 	die();
62
+}
60 63
 
61 64
 $keys = array_keys( $crons );
62 65
 $gmt_time = microtime( true );
63 66
 
64
-if ( isset($keys[0]) && $keys[0] > $gmt_time )
67
+if ( isset($keys[0]) && $keys[0] > $gmt_time ) {
65 68
 	die();
69
+}
66 70
 
67 71
 
68 72
 // The cron lock: a unix timestamp from when the cron was spawned.
@@ -72,8 +76,9 @@  discard block
 block discarded – undo
72 76
 if ( empty( $doing_wp_cron ) ) {
73 77
 	if ( empty( $_GET[ 'doing_wp_cron' ] ) ) {
74 78
 		// Called from external script/job. Try setting a lock.
75
-		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) )
76
-			return;
79
+		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {
80
+					return;
81
+		}
77 82
 		$doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
78 83
 		set_transient( 'doing_cron', $doing_wp_cron );
79 84
 	} else {
@@ -85,12 +90,14 @@  discard block
 block discarded – undo
85 90
  * The cron lock (a unix timestamp set when the cron was spawned),
86 91
  * must match $doing_wp_cron (the "key").
87 92
  */
88
-if ( $doing_cron_transient != $doing_wp_cron )
93
+if ( $doing_cron_transient != $doing_wp_cron ) {
89 94
 	return;
95
+}
90 96
 
91 97
 foreach ( $crons as $timestamp => $cronhooks ) {
92
-	if ( $timestamp > $gmt_time )
93
-		break;
98
+	if ( $timestamp > $gmt_time ) {
99
+			break;
100
+	}
94 101
 
95 102
 	foreach ( $cronhooks as $hook => $keys ) {
96 103
 
@@ -117,13 +124,15 @@  discard block
 block discarded – undo
117 124
  			do_action_ref_array( $hook, $v['args'] );
118 125
 
119 126
 			// If the hook ran too long and another cron process stole the lock, quit.
120
-			if ( _get_cron_lock() != $doing_wp_cron )
121
-				return;
127
+			if ( _get_cron_lock() != $doing_wp_cron ) {
128
+							return;
129
+			}
122 130
 		}
123 131
 	}
124 132
 }
125 133
 
126
-if ( _get_cron_lock() == $doing_wp_cron )
134
+if ( _get_cron_lock() == $doing_wp_cron ) {
127 135
 	delete_transient( 'doing_cron' );
136
+}
128 137
 
129 138
 die();
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/image.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
  */
55 55
 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
56 56
 foreach ( $attachments as $k => $attachment ) :
57
-	if ( $attachment->ID == $post->ID )
58
-		break;
59
-endforeach;
57
+	if ( $attachment->ID == $post->ID ) {
58
+			break;
59
+	}
60
+	endforeach;
60 61
 
61 62
 // If there is more than 1 attachment in a gallery
62 63
 if ( count( $attachments ) > 1 ) :
@@ -64,13 +65,17 @@  discard block
 block discarded – undo
64 65
 	if ( isset( $attachments[ $k ] ) ) :
65 66
 		// get the URL of the next image attachment
66 67
 		$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
67
-	else :
68
+	else {
69
+		:
68 70
 		// or get the URL of the first image attachment
69 71
 		$next_attachment_url = get_attachment_link( $attachments[0]->ID );
72
+	}
70 73
 	endif;
71
-else :
74
+else {
75
+	:
72 76
 	// or, if there's only 1 image, get the URL of the image
73 77
 	$next_attachment_url = wp_get_attachment_url();
78
+}
74 79
 endif;
75 80
 ?>
76 81
 								<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/sidebar-front.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@
 block discarded – undo
15 15
  *
16 16
  * If none of the sidebars have widgets, then let's bail early.
17 17
  */
18
-if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
18
+if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) {
19 19
 	return;
20
+}
20 21
 
21 22
 // If we get this far, we have widgets. Let do this.
22 23
 ?>
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/index.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
 
28 28
 			<?php twentytwelve_content_nav( 'nav-below' ); ?>
29 29
 
30
-		<?php else : ?>
30
+		<?php else {
31
+	: ?>
31 32
 
32 33
 			<article id="post-0" class="post no-results not-found">
33 34
 
@@ -35,18 +36,23 @@  discard block
 block discarded – undo
35 36
 				// Show a different message to a logged-in user who can add posts.
36 37
 			?>
37 38
 				<header class="entry-header">
38
-					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
39
+					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' );
40
+}
41
+?></h1>
39 42
 				</header>
40 43
 
41 44
 				<div class="entry-content">
42 45
 					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
43 46
 				</div><!-- .entry-content -->
44 47
 
45
-			<?php else :
48
+			<?php else {
49
+	:
46 50
 				// Show the default message to everyone else.
47 51
 			?>
48 52
 				<header class="entry-header">
49
-					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
53
+					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' );
54
+}
55
+?></h1>
50 56
 				</header>
51 57
 
52 58
 				<div class="entry-content">
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/functions.php 1 patch
Braces   +53 added lines, -37 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 // Set up the content width value based on the theme's design and stylesheet.
26
-if ( ! isset( $content_width ) )
26
+if ( ! isset( $content_width ) ) {
27 27
 	$content_width = 625;
28
+}
28 29
 
29 30
 /**
30 31
  * Twenty Twelve setup.
@@ -106,12 +107,13 @@  discard block
 block discarded – undo
106 107
 		 */
107 108
 		$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
108 109
 
109
-		if ( 'cyrillic' == $subset )
110
-			$subsets .= ',cyrillic,cyrillic-ext';
111
-		elseif ( 'greek' == $subset )
112
-			$subsets .= ',greek,greek-ext';
113
-		elseif ( 'vietnamese' == $subset )
114
-			$subsets .= ',vietnamese';
110
+		if ( 'cyrillic' == $subset ) {
111
+					$subsets .= ',cyrillic,cyrillic-ext';
112
+		} elseif ( 'greek' == $subset ) {
113
+					$subsets .= ',greek,greek-ext';
114
+		} elseif ( 'vietnamese' == $subset ) {
115
+					$subsets .= ',vietnamese';
116
+		}
115 117
 
116 118
 		$query_args = array(
117 119
 			'family' => 'Open+Sans:400italic,700italic,400,700',
@@ -135,15 +137,17 @@  discard block
 block discarded – undo
135 137
 	 * Adds JavaScript to pages with the comment form to support
136 138
 	 * sites with threaded comments (when in use).
137 139
 	 */
138
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
139
-		wp_enqueue_script( 'comment-reply' );
140
+	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
141
+			wp_enqueue_script( 'comment-reply' );
142
+	}
140 143
 
141 144
 	// Adds JavaScript for handling the navigation menu hide-and-show behavior.
142 145
 	wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
143 146
 
144 147
 	$font_url = twentytwelve_get_font_url();
145
-	if ( ! empty( $font_url ) )
146
-		wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
148
+	if ( ! empty( $font_url ) ) {
149
+			wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
150
+	}
147 151
 
148 152
 	// Loads our main stylesheet.
149 153
 	wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
@@ -169,11 +173,13 @@  discard block
 block discarded – undo
169 173
 function twentytwelve_mce_css( $mce_css ) {
170 174
 	$font_url = twentytwelve_get_font_url();
171 175
 
172
-	if ( empty( $font_url ) )
173
-		return $mce_css;
176
+	if ( empty( $font_url ) ) {
177
+			return $mce_css;
178
+	}
174 179
 
175
-	if ( ! empty( $mce_css ) )
176
-		$mce_css .= ',';
180
+	if ( ! empty( $mce_css ) ) {
181
+			$mce_css .= ',';
182
+	}
177 183
 
178 184
 	$mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) );
179 185
 
@@ -196,20 +202,23 @@  discard block
 block discarded – undo
196 202
 function twentytwelve_wp_title( $title, $sep ) {
197 203
 	global $paged, $page;
198 204
 
199
-	if ( is_feed() )
200
-		return $title;
205
+	if ( is_feed() ) {
206
+			return $title;
207
+	}
201 208
 
202 209
 	// Add the site name.
203 210
 	$title .= get_bloginfo( 'name', 'display' );
204 211
 
205 212
 	// Add the site description for the home/front page.
206 213
 	$site_description = get_bloginfo( 'description', 'display' );
207
-	if ( $site_description && ( is_home() || is_front_page() ) )
208
-		$title = "$title $sep $site_description";
214
+	if ( $site_description && ( is_home() || is_front_page() ) ) {
215
+			$title = "$title $sep $site_description";
216
+	}
209 217
 
210 218
 	// Add a page number if necessary.
211
-	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
212
-		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
219
+	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
220
+			$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
221
+	}
213 222
 
214 223
 	return $title;
215 224
 }
@@ -223,8 +232,9 @@  discard block
 block discarded – undo
223 232
  * @since Twenty Twelve 1.0
224 233
  */
225 234
 function twentytwelve_page_menu_args( $args ) {
226
-	if ( ! isset( $args['show_home'] ) )
227
-		$args['show_home'] = true;
235
+	if ( ! isset( $args['show_home'] ) ) {
236
+			$args['show_home'] = true;
237
+	}
228 238
 	return $args;
229 239
 }
230 240
 add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
@@ -422,30 +432,36 @@  discard block
 block discarded – undo
422 432
 	$background_color = get_background_color();
423 433
 	$background_image = get_background_image();
424 434
 
425
-	if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
426
-		$classes[] = 'full-width';
435
+	if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) {
436
+			$classes[] = 'full-width';
437
+	}
427 438
 
428 439
 	if ( is_page_template( 'page-templates/front-page.php' ) ) {
429 440
 		$classes[] = 'template-front-page';
430
-		if ( has_post_thumbnail() )
431
-			$classes[] = 'has-post-thumbnail';
432
-		if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
433
-			$classes[] = 'two-sidebars';
441
+		if ( has_post_thumbnail() ) {
442
+					$classes[] = 'has-post-thumbnail';
443
+		}
444
+		if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) {
445
+					$classes[] = 'two-sidebars';
446
+		}
434 447
 	}
435 448
 
436 449
 	if ( empty( $background_image ) ) {
437
-		if ( empty( $background_color ) )
438
-			$classes[] = 'custom-background-empty';
439
-		elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
440
-			$classes[] = 'custom-background-white';
450
+		if ( empty( $background_color ) ) {
451
+					$classes[] = 'custom-background-empty';
452
+		} elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) {
453
+					$classes[] = 'custom-background-white';
454
+		}
441 455
 	}
442 456
 
443 457
 	// Enable custom font class only if the font CSS is queued to load.
444
-	if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
445
-		$classes[] = 'custom-font-enabled';
458
+	if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) {
459
+			$classes[] = 'custom-font-enabled';
460
+	}
446 461
 
447
-	if ( ! is_multi_author() )
448
-		$classes[] = 'single-author';
462
+	if ( ! is_multi_author() ) {
463
+			$classes[] = 'single-author';
464
+	}
449 465
 
450 466
 	return $classes;
451 467
 }
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/category.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,11 @@
 block discarded – undo
40 40
 			twentytwelve_content_nav( 'nav-below' );
41 41
 			?>
42 42
 
43
-		<?php else : ?>
44
-			<?php get_template_part( 'content', 'none' ); ?>
43
+		<?php else {
44
+	: ?>
45
+			<?php get_template_part( 'content', 'none' );
46
+}
47
+?>
45 48
 		<?php endif; ?>
46 49
 
47 50
 		</div><!-- #content -->
Please login to merge, or discard this patch.