@@ -134,19 +134,19 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function __construct( $config, $object_id = 0 ) { |
136 | 136 | |
137 | - if ( empty( $config['id'] ) ) { |
|
137 | + if ( empty( $config[ 'id' ] ) ) { |
|
138 | 138 | wp_die( esc_html__( 'Metabox configuration is required to have an ID parameter.', 'cmb2' ) ); |
139 | 139 | } |
140 | 140 | |
141 | 141 | $this->meta_box = wp_parse_args( $config, $this->mb_defaults ); |
142 | - $this->meta_box['fields'] = array(); |
|
142 | + $this->meta_box[ 'fields' ] = array(); |
|
143 | 143 | |
144 | 144 | $this->object_id( $object_id ); |
145 | 145 | $this->mb_object_type(); |
146 | - $this->cmb_id = $config['id']; |
|
146 | + $this->cmb_id = $config[ 'id' ]; |
|
147 | 147 | |
148 | - if ( ! empty( $config['fields'] ) && is_array( $config['fields'] ) ) { |
|
149 | - $this->add_fields( $config['fields'] ); |
|
148 | + if ( ! empty( $config[ 'fields' ] ) && is_array( $config[ 'fields' ] ) ) { |
|
149 | + $this->add_fields( $config[ 'fields' ] ); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | CMB2_Boxes::add( $this ); |
@@ -256,17 +256,17 @@ discard block |
||
256 | 256 | |
257 | 257 | // Include custom class if requesting no title. |
258 | 258 | if ( ! $this->prop( 'title' ) && ! $this->prop( 'remove_box_wrap' ) ) { |
259 | - $context[] = 'cmb2-context-wrap-no-title'; |
|
259 | + $context[ ] = 'cmb2-context-wrap-no-title'; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | // Include a generic context wrapper. |
263 | - $context[] = 'cmb2-context-wrap'; |
|
263 | + $context[ ] = 'cmb2-context-wrap'; |
|
264 | 264 | |
265 | 265 | // Include a context-type based context wrapper. |
266 | - $context[] = 'cmb2-context-wrap-' . $this->prop( 'context' ); |
|
266 | + $context[ ] = 'cmb2-context-wrap-' . $this->prop( 'context' ); |
|
267 | 267 | |
268 | 268 | // Include an ID based context wrapper as well. |
269 | - $context[] = 'cmb2-context-wrap-' . $this->prop( 'id' ); |
|
269 | + $context[ ] = 'cmb2-context-wrap-' . $this->prop( 'id' ); |
|
270 | 270 | |
271 | 271 | // And merge all the classes back into the array. |
272 | 272 | $classes = array_merge( $classes, $context ); |
@@ -347,22 +347,22 @@ discard block |
||
347 | 347 | * @return mixed CMB2_Field object if successful. |
348 | 348 | */ |
349 | 349 | public function render_field( $field_args ) { |
350 | - $field_args['context'] = $this->prop( 'context' ); |
|
350 | + $field_args[ 'context' ] = $this->prop( 'context' ); |
|
351 | 351 | |
352 | - if ( 'group' == $field_args['type'] ) { |
|
352 | + if ( 'group' == $field_args[ 'type' ] ) { |
|
353 | 353 | |
354 | - if ( ! isset( $field_args['show_names'] ) ) { |
|
355 | - $field_args['show_names'] = $this->prop( 'show_names' ); |
|
354 | + if ( ! isset( $field_args[ 'show_names' ] ) ) { |
|
355 | + $field_args[ 'show_names' ] = $this->prop( 'show_names' ); |
|
356 | 356 | } |
357 | 357 | $field = $this->render_group( $field_args ); |
358 | 358 | |
359 | - } elseif ( 'hidden' == $field_args['type'] && $this->get_field( $field_args )->should_show() ) { |
|
359 | + } elseif ( 'hidden' == $field_args[ 'type' ] && $this->get_field( $field_args )->should_show() ) { |
|
360 | 360 | // Save rendering for after the metabox |
361 | 361 | $field = $this->add_hidden_field( $field_args ); |
362 | 362 | |
363 | 363 | } else { |
364 | 364 | |
365 | - $field_args['show_names'] = $this->prop( 'show_names' ); |
|
365 | + $field_args[ 'show_names' ] = $this->prop( 'show_names' ); |
|
366 | 366 | |
367 | 367 | // Render default fields |
368 | 368 | $field = $this->get_field( $field_args )->render_field(); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function render_group( $args ) { |
381 | 381 | |
382 | - if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) { |
|
382 | + if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) { |
|
383 | 383 | return; |
384 | 384 | } |
385 | 385 | |
@@ -491,15 +491,15 @@ discard block |
||
491 | 491 | <div class="inside cmb-td cmb-nested cmb-field-list">'; |
492 | 492 | // Loop and render repeatable group fields |
493 | 493 | foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) { |
494 | - if ( 'hidden' == $field_args['type'] ) { |
|
494 | + if ( 'hidden' == $field_args[ 'type' ] ) { |
|
495 | 495 | |
496 | 496 | // Save rendering for after the metabox |
497 | 497 | $this->add_hidden_field( $field_args, $field_group ); |
498 | 498 | |
499 | 499 | } else { |
500 | 500 | |
501 | - $field_args['show_names'] = $field_group->args( 'show_names' ); |
|
502 | - $field_args['context'] = $field_group->args( 'context' ); |
|
501 | + $field_args[ 'show_names' ] = $field_group->args( 'show_names' ); |
|
502 | + $field_args[ 'context' ] = $field_group->args( 'context' ); |
|
503 | 503 | |
504 | 504 | $field = $this->get_field( $field_args, $field_group )->render_field(); |
505 | 505 | } |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * @param CMB2_Field|null $field_group CMB2_Field group field object |
530 | 530 | */ |
531 | 531 | public function add_hidden_field( $field_args, $field_group = null ) { |
532 | - if ( isset( $field_args['field_args'] ) ) { |
|
532 | + if ( isset( $field_args[ 'field_args' ] ) ) { |
|
533 | 533 | // For back-compatibility. |
534 | 534 | $field = new CMB2_Field( $field_args ); |
535 | 535 | } else { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $types->iterator = $field_group->index; |
543 | 543 | } |
544 | 544 | |
545 | - $this->hidden_fields[] = $types; |
|
545 | + $this->hidden_fields[ ] = $types; |
|
546 | 546 | |
547 | 547 | return $field; |
548 | 548 | } |
@@ -650,11 +650,11 @@ discard block |
||
650 | 650 | */ |
651 | 651 | public function process_field( $field_args ) { |
652 | 652 | |
653 | - switch ( $field_args['type'] ) { |
|
653 | + switch ( $field_args[ 'type' ] ) { |
|
654 | 654 | |
655 | 655 | case 'group': |
656 | 656 | if ( $this->save_group( $field_args ) ) { |
657 | - $this->updated[] = $field_args['id']; |
|
657 | + $this->updated[ ] = $field_args[ 'id' ]; |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | break; |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | $field = $this->get_new_field( $field_args ); |
669 | 669 | |
670 | 670 | if ( $field->save_field_from_data( $this->data_to_save ) ) { |
671 | - $this->updated[] = $field->id(); |
|
671 | + $this->updated[ ] = $field->id(); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | break; |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | * @return mixed Return of CMB2_Field::update_data() |
737 | 737 | */ |
738 | 738 | public function save_group( $args ) { |
739 | - if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) { |
|
739 | + if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) { |
|
740 | 740 | return; |
741 | 741 | } |
742 | 742 | |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | $field_group->data_to_save = $this->data_to_save; |
767 | 767 | |
768 | 768 | foreach ( array_values( $field_group->fields() ) as $field_args ) { |
769 | - if ( 'title' === $field_args['type'] ) { |
|
769 | + if ( 'title' === $field_args[ 'type' ] ) { |
|
770 | 770 | // Don't process title fields |
771 | 771 | continue; |
772 | 772 | } |
@@ -789,16 +789,16 @@ discard block |
||
789 | 789 | $_new_val = array(); |
790 | 790 | foreach ( $new_val as $group_index => $grouped_data ) { |
791 | 791 | // Add the supporting data to the $saved array stack |
792 | - $saved[ $field_group->index ][ $grouped_data['supporting_field_id'] ][] = $grouped_data['supporting_field_value']; |
|
792 | + $saved[ $field_group->index ][ $grouped_data[ 'supporting_field_id' ] ][ ] = $grouped_data[ 'supporting_field_value' ]; |
|
793 | 793 | // Reset var to the actual value |
794 | - $_new_val[ $group_index ] = $grouped_data['value']; |
|
794 | + $_new_val[ $group_index ] = $grouped_data[ 'value' ]; |
|
795 | 795 | } |
796 | 796 | $new_val = $_new_val; |
797 | 797 | } else { |
798 | 798 | // Add the supporting data to the $saved array stack |
799 | - $saved[ $field_group->index ][ $new_val['supporting_field_id'] ] = $new_val['supporting_field_value']; |
|
799 | + $saved[ $field_group->index ][ $new_val[ 'supporting_field_id' ] ] = $new_val[ 'supporting_field_value' ]; |
|
800 | 800 | // Reset var to the actual value |
801 | - $new_val = $new_val['value']; |
|
801 | + $new_val = $new_val[ 'value' ]; |
|
802 | 802 | } |
803 | 803 | } |
804 | 804 | |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | |
813 | 813 | // Compare values and add to `$updated` array |
814 | 814 | if ( $is_updated || $is_removed ) { |
815 | - $this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id; |
|
815 | + $this->updated[ ] = $base_id . '::' . $field_group->index . '::' . $sub_id; |
|
816 | 816 | } |
817 | 817 | |
818 | 818 | // Add to `$saved` array |
@@ -850,22 +850,22 @@ discard block |
||
850 | 850 | // Try to get our object ID from the global space |
851 | 851 | switch ( $this->object_type() ) { |
852 | 852 | case 'user': |
853 | - $object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id; |
|
854 | - $object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id; |
|
853 | + $object_id = isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id; |
|
854 | + $object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS[ 'user_ID' ] ) ? $GLOBALS[ 'user_ID' ] : $object_id; |
|
855 | 855 | break; |
856 | 856 | |
857 | 857 | case 'comment': |
858 | - $object_id = isset( $_REQUEST['c'] ) ? $_REQUEST['c'] : $object_id; |
|
859 | - $object_id = ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ? $GLOBALS['comments']->comment_ID : $object_id; |
|
858 | + $object_id = isset( $_REQUEST[ 'c' ] ) ? $_REQUEST[ 'c' ] : $object_id; |
|
859 | + $object_id = ! $object_id && isset( $GLOBALS[ 'comments' ]->comment_ID ) ? $GLOBALS[ 'comments' ]->comment_ID : $object_id; |
|
860 | 860 | break; |
861 | 861 | |
862 | 862 | case 'term': |
863 | - $object_id = isset( $_REQUEST['tag_ID'] ) ? $_REQUEST['tag_ID'] : $object_id; |
|
863 | + $object_id = isset( $_REQUEST[ 'tag_ID' ] ) ? $_REQUEST[ 'tag_ID' ] : $object_id; |
|
864 | 864 | break; |
865 | 865 | |
866 | 866 | default: |
867 | - $object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id; |
|
868 | - $object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id; |
|
867 | + $object_id = isset( $GLOBALS[ 'post' ]->ID ) ? $GLOBALS[ 'post' ]->ID : $object_id; |
|
868 | + $object_id = isset( $_REQUEST[ 'post' ] ) ? $_REQUEST[ 'post' ] : $object_id; |
|
869 | 869 | break; |
870 | 870 | } |
871 | 871 | |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | * @return boolean True/False |
940 | 940 | */ |
941 | 941 | public function is_options_page_mb() { |
942 | - return ( isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key'] || array_key_exists( 'options-page', $this->meta_box['show_on'] ) ); |
|
942 | + return ( isset( $this->meta_box[ 'show_on' ][ 'key' ] ) && 'options-page' === $this->meta_box[ 'show_on' ][ 'key' ] || array_key_exists( 'options-page', $this->meta_box[ 'show_on' ] ) ); |
|
943 | 943 | } |
944 | 944 | |
945 | 945 | /** |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | $type = 'term'; |
986 | 986 | } |
987 | 987 | |
988 | - if ( defined( 'DOING_AJAX' ) && isset( $_POST['action'] ) && 'add-tag' === $_POST['action'] ) { |
|
988 | + if ( defined( 'DOING_AJAX' ) && isset( $_POST[ 'action' ] ) && 'add-tag' === $_POST[ 'action' ] ) { |
|
989 | 989 | $type = 'term'; |
990 | 990 | } |
991 | 991 | |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | return $field; |
1036 | 1036 | } |
1037 | 1037 | |
1038 | - $field_id = is_string( $field ) ? $field : $field['id']; |
|
1038 | + $field_id = is_string( $field ) ? $field : $field[ 'id' ]; |
|
1039 | 1039 | |
1040 | 1040 | $parent_field_id = ! empty( $field_group ) ? $field_group->id() : ''; |
1041 | 1041 | $ids = $this->get_field_ids( $field_id, $parent_field_id ); |
@@ -1072,16 +1072,16 @@ discard block |
||
1072 | 1072 | if ( $field_group && ( $sub_field_id || 0 === $sub_field_id ) ) { |
1073 | 1073 | |
1074 | 1074 | // Update the fields array w/ any modified properties inherited from the group field |
1075 | - $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] = $field_args; |
|
1075 | + $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] = $field_args; |
|
1076 | 1076 | |
1077 | 1077 | return $this->get_default_args( $field_args, $field_group ); |
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | if ( is_array( $field_args ) ) { |
1081 | - $this->meta_box['fields'][ $field_id ] = array_merge( $field_args, $this->meta_box['fields'][ $field_id ] ); |
|
1081 | + $this->meta_box[ 'fields' ][ $field_id ] = array_merge( $field_args, $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | - return $this->get_default_args( $this->meta_box['fields'][ $field_id ] ); |
|
1084 | + return $this->get_default_args( $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | /** |
@@ -1134,8 +1134,8 @@ discard block |
||
1134 | 1134 | |
1135 | 1135 | $sub_fields = false; |
1136 | 1136 | if ( array_key_exists( 'fields', $field ) ) { |
1137 | - $sub_fields = $field['fields']; |
|
1138 | - unset( $field['fields'] ); |
|
1137 | + $sub_fields = $field[ 'fields' ]; |
|
1138 | + unset( $field[ 'fields' ] ); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | $field_id = $parent_field_id |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | // Perform some field-type-specific initiation actions. |
1165 | - switch ( $field['type'] ) { |
|
1165 | + switch ( $field[ 'type' ] ) { |
|
1166 | 1166 | case 'file': |
1167 | 1167 | case 'file_list': |
1168 | 1168 | |
@@ -1177,21 +1177,21 @@ discard block |
||
1177 | 1177 | break; |
1178 | 1178 | } |
1179 | 1179 | |
1180 | - if ( isset( $field['column'] ) && false !== $field['column'] ) { |
|
1180 | + if ( isset( $field[ 'column' ] ) && false !== $field[ 'column' ] ) { |
|
1181 | 1181 | $field = $this->define_field_column( $field ); |
1182 | 1182 | } |
1183 | 1183 | |
1184 | - if ( isset( $field['taxonomy'] ) && ! empty( $field['remove_default'] ) ) { |
|
1185 | - $this->tax_metaboxes_to_remove[ $field['taxonomy'] ] = $field['taxonomy']; |
|
1184 | + if ( isset( $field[ 'taxonomy' ] ) && ! empty( $field[ 'remove_default' ] ) ) { |
|
1185 | + $this->tax_metaboxes_to_remove[ $field[ 'taxonomy' ] ] = $field[ 'taxonomy' ]; |
|
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | $this->_add_field_to_array( |
1189 | 1189 | $field, |
1190 | - $this->meta_box['fields'], |
|
1190 | + $this->meta_box[ 'fields' ], |
|
1191 | 1191 | $position |
1192 | 1192 | ); |
1193 | 1193 | |
1194 | - return $field['id']; |
|
1194 | + return $field[ 'id' ]; |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -1204,10 +1204,10 @@ discard block |
||
1204 | 1204 | protected function define_field_column( array $field ) { |
1205 | 1205 | $this->has_columns = true; |
1206 | 1206 | |
1207 | - $column = is_array( $field['column'] ) ? $field['column'] : array(); |
|
1207 | + $column = is_array( $field[ 'column' ] ) ? $field[ 'column' ] : array(); |
|
1208 | 1208 | |
1209 | - $field['column'] = wp_parse_args( $column, array( |
|
1210 | - 'name' => isset( $field['name'] ) ? $field['name'] : '', |
|
1209 | + $field[ 'column' ] = wp_parse_args( $column, array( |
|
1210 | + 'name' => isset( $field[ 'name' ] ) ? $field[ 'name' ] : '', |
|
1211 | 1211 | 'position' => false, |
1212 | 1212 | ) ); |
1213 | 1213 | |
@@ -1224,27 +1224,27 @@ discard block |
||
1224 | 1224 | * @return mixed Array of parent/field ids or false |
1225 | 1225 | */ |
1226 | 1226 | public function add_group_field( $parent_field_id, array $field, $position = 0 ) { |
1227 | - if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) { |
|
1227 | + if ( ! array_key_exists( $parent_field_id, $this->meta_box[ 'fields' ] ) ) { |
|
1228 | 1228 | return false; |
1229 | 1229 | } |
1230 | 1230 | |
1231 | - $parent_field = $this->meta_box['fields'][ $parent_field_id ]; |
|
1231 | + $parent_field = $this->meta_box[ 'fields' ][ $parent_field_id ]; |
|
1232 | 1232 | |
1233 | - if ( 'group' !== $parent_field['type'] ) { |
|
1233 | + if ( 'group' !== $parent_field[ 'type' ] ) { |
|
1234 | 1234 | return false; |
1235 | 1235 | } |
1236 | 1236 | |
1237 | - if ( ! isset( $parent_field['fields'] ) ) { |
|
1238 | - $this->meta_box['fields'][ $parent_field_id ]['fields'] = array(); |
|
1237 | + if ( ! isset( $parent_field[ 'fields' ] ) ) { |
|
1238 | + $this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ] = array(); |
|
1239 | 1239 | } |
1240 | 1240 | |
1241 | 1241 | $this->_add_field_to_array( |
1242 | 1242 | $field, |
1243 | - $this->meta_box['fields'][ $parent_field_id ]['fields'], |
|
1243 | + $this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ], |
|
1244 | 1244 | $position |
1245 | 1245 | ); |
1246 | 1246 | |
1247 | - return array( $parent_field_id, $field['id'] ); |
|
1247 | + return array( $parent_field_id, $field[ 'id' ] ); |
|
1248 | 1248 | } |
1249 | 1249 | |
1250 | 1250 | /** |
@@ -1257,9 +1257,9 @@ discard block |
||
1257 | 1257 | */ |
1258 | 1258 | protected function _add_field_to_array( $field, &$fields, $position = 0 ) { |
1259 | 1259 | if ( $position ) { |
1260 | - CMB2_Utils::array_insert( $fields, array( $field['id'] => $field ), $position ); |
|
1260 | + CMB2_Utils::array_insert( $fields, array( $field[ 'id' ] => $field ), $position ); |
|
1261 | 1261 | } else { |
1262 | - $fields[ $field['id'] ] = $field; |
|
1262 | + $fields[ $field[ 'id' ] ] = $field; |
|
1263 | 1263 | } |
1264 | 1264 | } |
1265 | 1265 | |
@@ -1283,15 +1283,15 @@ discard block |
||
1283 | 1283 | unset( $this->fields[ implode( '', $ids ) ] ); |
1284 | 1284 | |
1285 | 1285 | if ( ! $sub_field_id ) { |
1286 | - unset( $this->meta_box['fields'][ $field_id ] ); |
|
1286 | + unset( $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1287 | 1287 | return true; |
1288 | 1288 | } |
1289 | 1289 | |
1290 | - if ( isset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ) ) { |
|
1291 | - unset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ); |
|
1290 | + if ( isset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] ) ) { |
|
1291 | + unset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] ); |
|
1292 | 1292 | } |
1293 | - if ( isset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ) ) { |
|
1294 | - unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ); |
|
1293 | + if ( isset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] ) ) { |
|
1294 | + unset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] ); |
|
1295 | 1295 | } |
1296 | 1296 | return true; |
1297 | 1297 | } |
@@ -1316,11 +1316,11 @@ discard block |
||
1316 | 1316 | list( $field_id, $sub_field_id ) = $ids; |
1317 | 1317 | |
1318 | 1318 | if ( ! $sub_field_id ) { |
1319 | - $this->meta_box['fields'][ $field_id ][ $property ] = $value; |
|
1319 | + $this->meta_box[ 'fields' ][ $field_id ][ $property ] = $value; |
|
1320 | 1320 | return $field_id; |
1321 | 1321 | } |
1322 | 1322 | |
1323 | - $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value; |
|
1323 | + $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ][ $property ] = $value; |
|
1324 | 1324 | return $field_id; |
1325 | 1325 | } |
1326 | 1326 | |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | public function get_field_ids( $field_id, $parent_field_id = '' ) { |
1336 | 1336 | $sub_field_id = $parent_field_id ? $field_id : ''; |
1337 | 1337 | $field_id = $parent_field_id ? $parent_field_id : $field_id; |
1338 | - $fields =& $this->meta_box['fields']; |
|
1338 | + $fields = & $this->meta_box[ 'fields' ]; |
|
1339 | 1339 | |
1340 | 1340 | if ( ! array_key_exists( $field_id, $fields ) ) { |
1341 | 1341 | $field_id = $this->search_old_school_array( $field_id, $fields ); |
@@ -1349,12 +1349,12 @@ discard block |
||
1349 | 1349 | return array( $field_id, $sub_field_id ); |
1350 | 1350 | } |
1351 | 1351 | |
1352 | - if ( 'group' !== $fields[ $field_id ]['type'] ) { |
|
1352 | + if ( 'group' !== $fields[ $field_id ][ 'type' ] ) { |
|
1353 | 1353 | return false; |
1354 | 1354 | } |
1355 | 1355 | |
1356 | - if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) { |
|
1357 | - $sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] ); |
|
1356 | + if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ][ 'fields' ] ) ) { |
|
1357 | + $sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ][ 'fields' ] ); |
|
1358 | 1358 | } |
1359 | 1359 | |
1360 | 1360 | return false === $sub_field_id ? false : array( $field_id, $sub_field_id ); |