Completed
Push — trunk ( da902c...dba577 )
by Justin
05:50
created
includes/CMB2_Utils.php 2 patches
Spacing   +20 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$dir = wp_upload_dir();
31 31
 
32 32
 		// Is URL in uploads directory?
33
-		if ( false === strpos( $img_url, $dir['baseurl'] . '/' ) ) {
33
+		if ( false === strpos( $img_url, $dir[ 'baseurl' ] . '/' ) ) {
34 34
 			return false;
35 35
 		}
36 36
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 
56 56
 			foreach ( $query->posts as $post_id ) {
57 57
 				$meta = wp_get_attachment_metadata( $post_id );
58
-				$original_file       = basename( $meta['file'] );
59
-				$cropped_image_files = isset( $meta['sizes'] ) ? wp_list_pluck( $meta['sizes'], 'file' ) : array();
58
+				$original_file       = basename( $meta[ 'file' ] );
59
+				$cropped_image_files = isset( $meta[ 'sizes' ] ) ? wp_list_pluck( $meta[ 'sizes' ], 'file' ) : array();
60 60
 				if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
61 61
 					$attachment_id = $post_id;
62 62
 					break;
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
 		}
141 141
 
142 142
 		return $this->is_valid_time_stamp( $string )
143
-			? (int) $string :
144
-			strtotime( (string) $string );
143
+			? (int) $string : strtotime( (string) $string );
145 144
 	}
146 145
 
147 146
 	/**
@@ -172,7 +171,7 @@  discard block
 block discarded – undo
172 171
 	 * @param  mixed $value Value to check
173 172
 	 * @return bool         True or false
174 173
 	 */
175
-	public function notempty( $value ){
174
+	public function notempty( $value ) {
176 175
 		return null !== $value && '' !== $value && false !== $value;
177 176
 	}
178 177
 
@@ -322,24 +321,24 @@  discard block
 block discarded – undo
322 321
 
323 322
 		// order is relevant here, since the replacement will be done sequentially.
324 323
 		$supported_options = array(
325
-			'd' => 'dd',  // Day, leading 0
326
-			'j' => 'd',   // Day, no 0
327
-			'z' => 'o',   // Day of the year, no leading zeroes,
324
+			'd' => 'dd', // Day, leading 0
325
+			'j' => 'd', // Day, no 0
326
+			'z' => 'o', // Day of the year, no leading zeroes,
328 327
 			// 'D' => 'D',   // Day name short, not sure how it'll work with translations
329 328
 			// 'l' => 'DD',  // Day name full, idem before
330
-			'm' => 'mm',  // Month of the year, leading 0
331
-			'n' => 'm',   // Month of the year, no leading 0
329
+			'm' => 'mm', // Month of the year, leading 0
330
+			'n' => 'm', // Month of the year, no leading 0
332 331
 			// 'M' => 'M',   // Month, Short name
333 332
 			// 'F' => 'MM',  // Month, full name,
334
-			'y' => 'y',   // Year, two digit
335
-			'Y' => 'yy',  // Year, full
336
-			'H' => 'HH',  // Hour with leading 0 (24 hour)
337
-			'G' => 'H',   // Hour with no leading 0 (24 hour)
338
-			'h' => 'hh',  // Hour with leading 0 (12 hour)
339
-			'g' => 'h',   // Hour with no leading 0 (12 hour),
340
-			'i' => 'mm',  // Minute with leading 0,
341
-			's' => 'ss',  // Second with leading 0,
342
-			'a' => 'tt',  // am/pm
333
+			'y' => 'y', // Year, two digit
334
+			'Y' => 'yy', // Year, full
335
+			'H' => 'HH', // Hour with leading 0 (24 hour)
336
+			'G' => 'H', // Hour with no leading 0 (24 hour)
337
+			'h' => 'hh', // Hour with leading 0 (12 hour)
338
+			'g' => 'h', // Hour with no leading 0 (12 hour),
339
+			'i' => 'mm', // Minute with leading 0,
340
+			's' => 'ss', // Second with leading 0,
341
+			'a' => 'tt', // am/pm
343 342
 			'A' => 'TT'   // AM/PM
344 343
 		);
345 344
 
@@ -360,7 +359,7 @@  discard block
 block discarded – undo
360 359
 	 * @return string Modified value
361 360
 	 */
362 361
 	public function wrap_escaped_chars( $value ) {
363
-		return "'" . str_replace( '\\', '', $value[0] ) . "'";
362
+		return "'" . str_replace( '\\', '', $value[ 0 ] ) . "'";
364 363
 	}
365 364
 
366 365
 	/**
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,7 +115,8 @@  discard block
 block discarded – undo
115 115
 			$tzstring = '';
116 116
 		}
117 117
 
118
-		if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
118
+		if ( empty( $tzstring ) ) {
119
+// Create a UTC+- zone if no timezone string exists
119 120
 			if ( 0 == $current_offset ) {
120 121
 				$tzstring = 'UTC+0';
121 122
 			} elseif ( $current_offset < 0 ) {
@@ -172,7 +173,7 @@  discard block
 block discarded – undo
172 173
 	 * @param  mixed $value Value to check
173 174
 	 * @return bool         True or false
174 175
 	 */
175
-	public function notempty( $value ){
176
+	public function notempty( $value ) {
176 177
 		return null !== $value && '' !== $value && false !== $value;
177 178
 	}
178 179
 
Please login to merge, or discard this patch.