@@ 16-37 (lines=22) @@ | ||
13 | * @return (boolean) |
|
14 | */ |
|
15 | ||
16 | function acf_is_field_group_key( $key = '' ) { |
|
17 | ||
18 | // bail early if not string |
|
19 | if( !is_string($key) ) return false; |
|
20 | ||
21 | ||
22 | // bail early if is numeric (could be numeric string '123') |
|
23 | if( is_numeric($key) ) return false; |
|
24 | ||
25 | ||
26 | // look for 'field_' prefix |
|
27 | if( substr($key, 0, 6) === 'group_' ) return true; |
|
28 | ||
29 | ||
30 | // allow local field group key to not start with prefix |
|
31 | if( acf_is_local_field_group($key) ) return true; |
|
32 | ||
33 | ||
34 | // return |
|
35 | return false; |
|
36 | ||
37 | } |
|
38 | ||
39 | ||
40 | /* |
@@ 102-123 (lines=22) @@ | ||
99 | * @return (boolean) |
|
100 | */ |
|
101 | ||
102 | function acf_is_field_key( $key = '' ) { |
|
103 | ||
104 | // bail early if not string |
|
105 | if( !is_string($key) ) return false; |
|
106 | ||
107 | ||
108 | // bail early if is numeric (could be numeric string '123') |
|
109 | if( is_numeric($key) ) return false; |
|
110 | ||
111 | ||
112 | // default - starts with 'field_' |
|
113 | if( substr($key, 0, 6) === 'field_' ) return true; |
|
114 | ||
115 | ||
116 | // special - allow local field key to be any string |
|
117 | if( acf_is_local_field($key) ) return true; |
|
118 | ||
119 | ||
120 | // return |
|
121 | return false; |
|
122 | ||
123 | } |
|
124 | ||
125 | ||
126 | /* |