@@ -11,7 +11,10 @@ discard block |
||
| 11 | 11 | Domain Path: /lang |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 14 | +if( ! defined( 'ABSPATH' ) ) { |
|
| 15 | + exit; |
|
| 16 | +} |
|
| 17 | +// Exit if accessed directly |
|
| 15 | 18 | |
| 16 | 19 | if( ! class_exists('acf') ) : |
| 17 | 20 | |
@@ -168,11 +171,15 @@ discard block |
||
| 168 | 171 | function init() { |
| 169 | 172 | |
| 170 | 173 | // bail early if a plugin called get_field early |
| 171 | - if( !did_action('plugins_loaded') ) return; |
|
| 174 | + if( !did_action('plugins_loaded') ) { |
|
| 175 | + return; |
|
| 176 | + } |
|
| 172 | 177 | |
| 173 | 178 | |
| 174 | 179 | // bail early if already init |
| 175 | - if( acf_get_setting('init') ) return; |
|
| 180 | + if( acf_get_setting('init') ) { |
|
| 181 | + return; |
|
| 182 | + } |
|
| 176 | 183 | |
| 177 | 184 | |
| 178 | 185 | // only run once |
@@ -85,8 +85,7 @@ |
||
| 85 | 85 | if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) |
| 86 | 86 | { |
| 87 | 87 | acf_add_admin_notice(__('<b>Error</b>. Could not load add-ons list', 'acf'), 'error'); |
| 88 | - } |
|
| 89 | - else |
|
| 88 | + } else |
|
| 90 | 89 | { |
| 91 | 90 | $this->view['json'] = json_decode( $request['body'], true ); |
| 92 | 91 | } |
@@ -436,7 +436,9 @@ |
||
| 436 | 436 | |
| 437 | 437 | |
| 438 | 438 | // validate field group |
| 439 | - if( empty($field_group) ) continue; |
|
| 439 | + if( empty($field_group) ) { |
|
| 440 | + continue; |
|
| 441 | + } |
|
| 440 | 442 | |
| 441 | 443 | |
| 442 | 444 | // load fields |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if( !defined('ABSPATH') ) exit; |
|
| 15 | +if( !defined('ABSPATH') ) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | |
| 18 | 20 | // global |
@@ -65,8 +65,11 @@ |
||
| 65 | 65 | <li class="li-field-type"> |
| 66 | 66 | <?php if( acf_field_type_exists($field['type']) ): ?> |
| 67 | 67 | <?php echo acf_get_field_type_label($field['type']); ?> |
| 68 | - <?php else: ?> |
|
| 69 | - <b><?php _e('Error', 'acf'); ?></b> <?php _e('Field type does not exist', 'acf'); ?> |
|
| 68 | + <?php else { |
|
| 69 | + : ?> |
|
| 70 | + <b><?php _e('Error', 'acf'); |
|
| 71 | +} |
|
| 72 | +?></b> <?php _e('Field type does not exist', 'acf'); ?> |
|
| 70 | 73 | <?php endif; ?> |
| 71 | 74 | </li> |
| 72 | 75 | </ul> |
@@ -40,8 +40,11 @@ |
||
| 40 | 40 | <div class="footer"> |
| 41 | 41 | <?php if( apply_filters("acf/is_add_on_active/slug={$addon['slug']}", false ) ): ?> |
| 42 | 42 | <a class="acf-button" disabled="disabled"><?php _e("Installed",'acf'); ?></a> |
| 43 | - <?php else: ?> |
|
| 44 | - <a class="acf-button <?php echo $addon['btn_color']; ?>" target="_blank" href="<?php echo $addon['url']; ?>" ><?php _e($addon['btn']); ?></a> |
|
| 43 | + <?php else { |
|
| 44 | + : ?> |
|
| 45 | + <a class="acf-button <?php echo $addon['btn_color']; |
|
| 46 | +} |
|
| 47 | +?>" target="_blank" href="<?php echo $addon['url']; ?>" ><?php _e($addon['btn']); ?></a> |
|
| 45 | 48 | <?php endif; ?> |
| 46 | 49 | |
| 47 | 50 | <?php if( !empty($addon['footer']) ): ?> |
@@ -45,8 +45,11 @@ |
||
| 45 | 45 | <td> |
| 46 | 46 | <?php if( $site['updates'] ): ?> |
| 47 | 47 | <span class="response"><?php printf(__('Site requires database upgrade from %s to %s', 'acf'), $site['acf_version'], $plugin_version); ?></span> |
| 48 | - <?php else: ?> |
|
| 49 | - <?php _e("Site is up to date", 'acf'); ?> |
|
| 48 | + <?php else { |
|
| 49 | + : ?> |
|
| 50 | + <?php _e("Site is up to date", 'acf'); |
|
| 51 | +} |
|
| 52 | +?> |
|
| 50 | 53 | <?php endif; ?> |
| 51 | 54 | </td> |
| 52 | 55 | </tr> |
@@ -105,9 +105,12 @@ |
||
| 105 | 105 | })(jQuery); |
| 106 | 106 | </script> |
| 107 | 107 | |
| 108 | -<?php else: ?> |
|
| 108 | +<?php else { |
|
| 109 | + : ?> |
|
| 109 | 110 | |
| 110 | - <p><?php _e('No updates available', 'acf'); ?>.</p> |
|
| 111 | + <p><?php _e('No updates available', 'acf'); |
|
| 112 | +} |
|
| 113 | +?>.</p> |
|
| 111 | 114 | |
| 112 | 115 | <?php endif; ?> |
| 113 | 116 | |
@@ -16,19 +16,27 @@ discard block |
||
| 16 | 16 | function acf_is_field_group_key( $key = '' ) { |
| 17 | 17 | |
| 18 | 18 | // bail early if not string |
| 19 | - if( !is_string($key) ) return false; |
|
| 19 | + if( !is_string($key) ) { |
|
| 20 | + return false; |
|
| 21 | + } |
|
| 20 | 22 | |
| 21 | 23 | |
| 22 | 24 | // bail early if is numeric (could be numeric string '123') |
| 23 | - if( is_numeric($key) ) return false; |
|
| 25 | + if( is_numeric($key) ) { |
|
| 26 | + return false; |
|
| 27 | + } |
|
| 24 | 28 | |
| 25 | 29 | |
| 26 | 30 | // look for 'field_' prefix |
| 27 | - if( substr($key, 0, 6) === 'group_' ) return true; |
|
| 31 | + if( substr($key, 0, 6) === 'group_' ) { |
|
| 32 | + return true; |
|
| 33 | + } |
|
| 28 | 34 | |
| 29 | 35 | |
| 30 | 36 | // allow local field group key to not start with prefix |
| 31 | - if( acf_is_local_field_group($key) ) return true; |
|
| 37 | + if( acf_is_local_field_group($key) ) { |
|
| 38 | + return true; |
|
| 39 | + } |
|
| 32 | 40 | |
| 33 | 41 | |
| 34 | 42 | // return |
@@ -259,7 +267,9 @@ discard block |
||
| 259 | 267 | $found = false; |
| 260 | 268 | $cache = wp_cache_get( $cache_key, 'acf', false, $found ); |
| 261 | 269 | |
| 262 | - if( $found ) return $cache; |
|
| 270 | + if( $found ) { |
|
| 271 | + return $cache; |
|
| 272 | + } |
|
| 263 | 273 | |
| 264 | 274 | |
| 265 | 275 | // get field group from ID or key |
@@ -683,7 +693,9 @@ discard block |
||
| 683 | 693 | |
| 684 | 694 | |
| 685 | 695 | // bail early if field group did not load correctly |
| 686 | - if( empty($field_group) ) return false; |
|
| 696 | + if( empty($field_group) ) { |
|
| 697 | + return false; |
|
| 698 | + } |
|
| 687 | 699 | |
| 688 | 700 | |
| 689 | 701 | // get fields |
@@ -738,7 +750,9 @@ discard block |
||
| 738 | 750 | |
| 739 | 751 | |
| 740 | 752 | // bail early if field group did not load correctly |
| 741 | - if( empty($field_group) ) return false; |
|
| 753 | + if( empty($field_group) ) { |
|
| 754 | + return false; |
|
| 755 | + } |
|
| 742 | 756 | |
| 743 | 757 | |
| 744 | 758 | // get fields |
@@ -793,7 +807,9 @@ discard block |
||
| 793 | 807 | |
| 794 | 808 | |
| 795 | 809 | // bail early if field group did not load correctly |
| 796 | - if( empty($field_group) ) return false; |
|
| 810 | + if( empty($field_group) ) { |
|
| 811 | + return false; |
|
| 812 | + } |
|
| 797 | 813 | |
| 798 | 814 | |
| 799 | 815 | // get fields |