@@ -123,7 +123,9 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | // return true if already done |
| 126 | - if( acf_get_setting($setting) ) return true; |
|
| 126 | + if( acf_get_setting($setting) ) { |
|
| 127 | + return true; |
|
| 128 | + } |
|
| 127 | 129 | |
| 128 | 130 | |
| 129 | 131 | // update setting |
@@ -1105,7 +1107,9 @@ discard block |
||
| 1105 | 1107 | |
| 1106 | 1108 | |
| 1107 | 1109 | // bail early i no terms |
| 1108 | - if( empty($terms) ) continue; |
|
| 1110 | + if( empty($terms) ) { |
|
| 1111 | + continue; |
|
| 1112 | + } |
|
| 1109 | 1113 | |
| 1110 | 1114 | |
| 1111 | 1115 | // sort into hierachial order! |
@@ -1957,7 +1961,7 @@ discard block |
||
| 1957 | 1961 | |
| 1958 | 1962 | $arg = $arg ? 'true' : 'false'; |
| 1959 | 1963 | |
| 1960 | - }elseif( is_string($arg) ) { |
|
| 1964 | + } elseif( is_string($arg) ) { |
|
| 1961 | 1965 | |
| 1962 | 1966 | $arg = '"' . $arg . '"'; |
| 1963 | 1967 | |
@@ -3342,7 +3346,7 @@ discard block |
||
| 3342 | 3346 | // min height |
| 3343 | 3347 | $errors['min_height'] = sprintf(__('Image height must be at least %dpx.', 'acf'), $min_height ); |
| 3344 | 3348 | |
| 3345 | - } elseif( $max_height && $file['height'] > $max_height ) { |
|
| 3349 | + } elseif( $max_height && $file['height'] > $max_height ) { |
|
| 3346 | 3350 | |
| 3347 | 3351 | // min height |
| 3348 | 3352 | $errors['max_height'] = sprintf(__('Image height must not exceed %dpx.', 'acf'), $max_height ); |
@@ -3468,14 +3472,18 @@ discard block |
||
| 3468 | 3472 | function acf_translate_keys( $array, $keys ) { |
| 3469 | 3473 | |
| 3470 | 3474 | // bail early if no keys |
| 3471 | - if( empty($keys) ) return $array; |
|
| 3475 | + if( empty($keys) ) { |
|
| 3476 | + return $array; |
|
| 3477 | + } |
|
| 3472 | 3478 | |
| 3473 | 3479 | |
| 3474 | 3480 | // translate |
| 3475 | 3481 | foreach( $keys as $k ) { |
| 3476 | 3482 | |
| 3477 | 3483 | // bail ealry if not exists |
| 3478 | - if( !isset($array[ $k ]) ) continue; |
|
| 3484 | + if( !isset($array[ $k ]) ) { |
|
| 3485 | + continue; |
|
| 3486 | + } |
|
| 3479 | 3487 | |
| 3480 | 3488 | |
| 3481 | 3489 | // translate |
@@ -3507,11 +3515,15 @@ discard block |
||
| 3507 | 3515 | function acf_translate( $string ) { |
| 3508 | 3516 | |
| 3509 | 3517 | // bail early if not enabled |
| 3510 | - if( !acf_get_setting('l10n') ) return $string; |
|
| 3518 | + if( !acf_get_setting('l10n') ) { |
|
| 3519 | + return $string; |
|
| 3520 | + } |
|
| 3511 | 3521 | |
| 3512 | 3522 | |
| 3513 | 3523 | // bail early if no textdomain |
| 3514 | - if( !acf_get_setting('l10n_textdomain') ) return $string; |
|
| 3524 | + if( !acf_get_setting('l10n_textdomain') ) { |
|
| 3525 | + return $string; |
|
| 3526 | + } |
|
| 3515 | 3527 | |
| 3516 | 3528 | |
| 3517 | 3529 | // is array |
@@ -3523,11 +3535,15 @@ discard block |
||
| 3523 | 3535 | |
| 3524 | 3536 | |
| 3525 | 3537 | // bail early if not string |
| 3526 | - if( !is_string($string) ) return $string; |
|
| 3538 | + if( !is_string($string) ) { |
|
| 3539 | + return $string; |
|
| 3540 | + } |
|
| 3527 | 3541 | |
| 3528 | 3542 | |
| 3529 | 3543 | // bail early if empty |
| 3530 | - if( $string === '' ) return $string; |
|
| 3544 | + if( $string === '' ) { |
|
| 3545 | + return $string; |
|
| 3546 | + } |
|
| 3531 | 3547 | |
| 3532 | 3548 | |
| 3533 | 3549 | // allow for var_export export |
@@ -654,7 +654,9 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | |
| 656 | 656 | // bail early if no row |
| 657 | - if( !$row ) return 0; |
|
| 657 | + if( !$row ) { |
|
| 658 | + return 0; |
|
| 659 | + } |
|
| 658 | 660 | |
| 659 | 661 | |
| 660 | 662 | // return |
@@ -683,8 +685,7 @@ discard block |
||
| 683 | 685 | if( $hard_reset ) |
| 684 | 686 | { |
| 685 | 687 | $GLOBALS['acf_field'] = array(); |
| 686 | - } |
|
| 687 | - else |
|
| 688 | + } else |
|
| 688 | 689 | { |
| 689 | 690 | // vars |
| 690 | 691 | $depth = count( $GLOBALS['acf_field'] ) - 1; |
@@ -1749,7 +1750,9 @@ discard block |
||
| 1749 | 1750 | |
| 1750 | 1751 | |
| 1751 | 1752 | // bail early if no field |
| 1752 | - if( !$field ) return false; |
|
| 1753 | + if( !$field ) { |
|
| 1754 | + return false; |
|
| 1755 | + } |
|
| 1753 | 1756 | |
| 1754 | 1757 | |
| 1755 | 1758 | // update sub fields |
@@ -299,7 +299,9 @@ |
||
| 299 | 299 | function acf_get_value( $post_id = 0, $field ) { |
| 300 | 300 | |
| 301 | 301 | // bail early if no $post_id (acf_form - new_post) |
| 302 | - if( !$post_id ) return null; |
|
| 302 | + if( !$post_id ) { |
|
| 303 | + return null; |
|
| 304 | + } |
|
| 303 | 305 | |
| 304 | 306 | |
| 305 | 307 | // try cache |
@@ -148,8 +148,7 @@ |
||
| 148 | 148 | if( isset($l10n[ $this->category ]) ) |
| 149 | 149 | { |
| 150 | 150 | $cat = $l10n[ $this->category ]; |
| 151 | - } |
|
| 152 | - else |
|
| 151 | + } else |
|
| 153 | 152 | { |
| 154 | 153 | $cat = $this->category; |
| 155 | 154 | } |
@@ -130,7 +130,9 @@ discard block |
||
| 130 | 130 | function save_post( $post_id = 0 ) { |
| 131 | 131 | |
| 132 | 132 | // bai learly if empty |
| 133 | - if( empty($_POST['acf']) ) return; |
|
| 133 | + if( empty($_POST['acf']) ) { |
|
| 134 | + return; |
|
| 135 | + } |
|
| 134 | 136 | |
| 135 | 137 | |
| 136 | 138 | // save $_POST data |
@@ -141,7 +143,9 @@ discard block |
||
| 141 | 143 | |
| 142 | 144 | |
| 143 | 145 | // continue if no field |
| 144 | - if( !$field ) continue; |
|
| 146 | + if( !$field ) { |
|
| 147 | + continue; |
|
| 148 | + } |
|
| 145 | 149 | |
| 146 | 150 | |
| 147 | 151 | // update |
@@ -348,11 +352,15 @@ discard block |
||
| 348 | 352 | function acf_enqueue_uploader() { |
| 349 | 353 | |
| 350 | 354 | // bail early if doing ajax |
| 351 | - if( defined('DOING_AJAX') && DOING_AJAX ) return; |
|
| 355 | + if( defined('DOING_AJAX') && DOING_AJAX ) { |
|
| 356 | + return; |
|
| 357 | + } |
|
| 352 | 358 | |
| 353 | 359 | |
| 354 | 360 | // bail ealry if already run |
| 355 | - if( acf_has_done('enqueue_uploader') ) return; |
|
| 361 | + if( acf_has_done('enqueue_uploader') ) { |
|
| 362 | + return; |
|
| 363 | + } |
|
| 356 | 364 | |
| 357 | 365 | |
| 358 | 366 | // enqueue media if user can upload |
@@ -436,7 +444,9 @@ discard block |
||
| 436 | 444 | function acf_save_post( $post_id = 0 ) { |
| 437 | 445 | |
| 438 | 446 | // bail early if no acf values |
| 439 | - if( empty($_POST['acf']) ) return false; |
|
| 447 | + if( empty($_POST['acf']) ) { |
|
| 448 | + return false; |
|
| 449 | + } |
|
| 440 | 450 | |
| 441 | 451 | |
| 442 | 452 | // hook for 3rd party customization |
@@ -633,7 +643,9 @@ discard block |
||
| 633 | 643 | function acf_get_validation_errors() { |
| 634 | 644 | |
| 635 | 645 | // bail early if no errors |
| 636 | - if( empty($GLOBALS['acf_validation_errors']) ) return false; |
|
| 646 | + if( empty($GLOBALS['acf_validation_errors']) ) { |
|
| 647 | + return false; |
|
| 648 | + } |
|
| 637 | 649 | |
| 638 | 650 | |
| 639 | 651 | // return |
@@ -194,7 +194,9 @@ |
||
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | // bail early if dir does not exist |
| 197 | - if( !is_writable($path) ) return false; |
|
| 197 | + if( !is_writable($path) ) { |
|
| 198 | + return false; |
|
| 199 | + } |
|
| 198 | 200 | |
| 199 | 201 | |
| 200 | 202 | // prepare for export |
@@ -149,12 +149,10 @@ discard block |
||
| 149 | 149 | if( isset($_POST['post_id']) ) |
| 150 | 150 | { |
| 151 | 151 | $post_id = $_POST['post_id']; |
| 152 | - } |
|
| 153 | - elseif( isset($post->ID) ) |
|
| 152 | + } elseif( isset($post->ID) ) |
|
| 154 | 153 | { |
| 155 | 154 | $post_id = $post->ID; |
| 156 | - } |
|
| 157 | - else |
|
| 155 | + } else |
|
| 158 | 156 | { |
| 159 | 157 | return $return; |
| 160 | 158 | } |
@@ -245,13 +243,11 @@ discard block |
||
| 245 | 243 | { |
| 246 | 244 | // WP 3.6 |
| 247 | 245 | $post_id = $post->ID; |
| 248 | - } |
|
| 249 | - elseif( isset($_GET['revision']) ) |
|
| 246 | + } elseif( isset($_GET['revision']) ) |
|
| 250 | 247 | { |
| 251 | 248 | // WP 3.5 |
| 252 | 249 | $post_id = (int) $_GET['revision']; |
| 253 | - } |
|
| 254 | - elseif( strpos($value, 'revision_id=') !== false ) |
|
| 250 | + } elseif( strpos($value, 'revision_id=') !== false ) |
|
| 255 | 251 | { |
| 256 | 252 | // WP 3.5 (left vs right) |
| 257 | 253 | $post_id = (int) str_replace('revision_id=', '', $value); |
@@ -164,9 +164,12 @@ |
||
| 164 | 164 | |
| 165 | 165 | <input type="file" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" /> |
| 166 | 166 | |
| 167 | - <?php else: ?> |
|
| 167 | + <?php else { |
|
| 168 | + : ?> |
|
| 168 | 169 | |
| 169 | - <p style="margin:0;"><?php _e('No File selected','acf'); ?> <a data-name="add" class="acf-button" href="#"><?php _e('Add File','acf'); ?></a></p> |
|
| 170 | + <p style="margin:0;"><?php _e('No File selected','acf'); |
|
| 171 | +} |
|
| 172 | +?> <a data-name="add" class="acf-button" href="#"><?php _e('Add File','acf'); ?></a></p> |
|
| 170 | 173 | |
| 171 | 174 | <?php endif; ?> |
| 172 | 175 | |
@@ -142,9 +142,12 @@ |
||
| 142 | 142 | |
| 143 | 143 | <input type="file" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" /> |
| 144 | 144 | |
| 145 | - <?php else: ?> |
|
| 145 | + <?php else { |
|
| 146 | + : ?> |
|
| 146 | 147 | |
| 147 | - <p style="margin:0;"><?php _e('No image selected','acf'); ?> <a data-name="add" class="acf-button" href="#"><?php _e('Add Image','acf'); ?></a></p> |
|
| 148 | + <p style="margin:0;"><?php _e('No image selected','acf'); |
|
| 149 | +} |
|
| 150 | +?> <a data-name="add" class="acf-button" href="#"><?php _e('Add Image','acf'); ?></a></p> |
|
| 148 | 151 | |
| 149 | 152 | <?php endif; ?> |
| 150 | 153 | </div> |