@@ -123,19 +123,19 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function __construct( $config, $object_id = 0 ) { |
125 | 125 | |
126 | - if ( empty( $config['id'] ) ) { |
|
126 | + if ( empty( $config[ 'id' ] ) ) { |
|
127 | 127 | wp_die( esc_html__( 'Metabox configuration is required to have an ID parameter.', 'cmb2' ) ); |
128 | 128 | } |
129 | 129 | |
130 | 130 | $this->meta_box = wp_parse_args( $config, $this->mb_defaults ); |
131 | - $this->meta_box['fields'] = array(); |
|
131 | + $this->meta_box[ 'fields' ] = array(); |
|
132 | 132 | |
133 | 133 | $this->object_id( $object_id ); |
134 | 134 | $this->mb_object_type(); |
135 | - $this->cmb_id = $config['id']; |
|
135 | + $this->cmb_id = $config[ 'id' ]; |
|
136 | 136 | |
137 | - if ( ! empty( $config['fields'] ) && is_array( $config['fields'] ) ) { |
|
138 | - $this->add_fields( $config['fields'] ); |
|
137 | + if ( ! empty( $config[ 'fields' ] ) && is_array( $config[ 'fields' ] ) ) { |
|
138 | + $this->add_fields( $config[ 'fields' ] ); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | CMB2_Boxes::add( $this ); |
@@ -243,17 +243,17 @@ discard block |
||
243 | 243 | |
244 | 244 | // Include custom class if requesting no title. |
245 | 245 | if ( empty( $this->prop( 'title' ) ) && empty( $this->prop( 'remove_box_wrap' ) ) ) { |
246 | - $context[] = 'cmb2-context-wrap-no-title'; |
|
246 | + $context[ ] = 'cmb2-context-wrap-no-title'; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // Include a generic context wrapper. |
250 | - $context[] = 'cmb2-context-wrap'; |
|
250 | + $context[ ] = 'cmb2-context-wrap'; |
|
251 | 251 | |
252 | 252 | // Include a context-type based context wrapper. |
253 | - $context[] = 'cmb2-context-wrap-' . $this->prop( 'context' ); |
|
253 | + $context[ ] = 'cmb2-context-wrap-' . $this->prop( 'context' ); |
|
254 | 254 | |
255 | 255 | // Include an ID based context wrapper as well. |
256 | - $context[] = 'cmb2-context-wrap-' . $this->prop( 'id' ); |
|
256 | + $context[ ] = 'cmb2-context-wrap-' . $this->prop( 'id' ); |
|
257 | 257 | |
258 | 258 | // And merge all the classes back into the array. |
259 | 259 | $classes = array_merge( $classes, $context ); |
@@ -332,22 +332,22 @@ discard block |
||
332 | 332 | * @return mixed CMB2_Field object if successful. |
333 | 333 | */ |
334 | 334 | public function render_field( $field_args ) { |
335 | - $field_args['context'] = $this->prop( 'context' ); |
|
335 | + $field_args[ 'context' ] = $this->prop( 'context' ); |
|
336 | 336 | |
337 | - if ( 'group' == $field_args['type'] ) { |
|
337 | + if ( 'group' == $field_args[ 'type' ] ) { |
|
338 | 338 | |
339 | - if ( ! isset( $field_args['show_names'] ) ) { |
|
340 | - $field_args['show_names'] = $this->prop( 'show_names' ); |
|
339 | + if ( ! isset( $field_args[ 'show_names' ] ) ) { |
|
340 | + $field_args[ 'show_names' ] = $this->prop( 'show_names' ); |
|
341 | 341 | } |
342 | 342 | $field = $this->render_group( $field_args ); |
343 | 343 | |
344 | - } elseif ( 'hidden' == $field_args['type'] && $this->get_field( $field_args )->should_show() ) { |
|
344 | + } elseif ( 'hidden' == $field_args[ 'type' ] && $this->get_field( $field_args )->should_show() ) { |
|
345 | 345 | // Save rendering for after the metabox |
346 | 346 | $field = $this->add_hidden_field( $field_args ); |
347 | 347 | |
348 | 348 | } else { |
349 | 349 | |
350 | - $field_args['show_names'] = $this->prop( 'show_names' ); |
|
350 | + $field_args[ 'show_names' ] = $this->prop( 'show_names' ); |
|
351 | 351 | |
352 | 352 | // Render default fields |
353 | 353 | $field = $this->get_field( $field_args )->render_field(); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function render_group( $args ) { |
365 | 365 | |
366 | - if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) { |
|
366 | + if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
@@ -473,15 +473,15 @@ discard block |
||
473 | 473 | <div class="inside cmb-td cmb-nested cmb-field-list">'; |
474 | 474 | // Loop and render repeatable group fields |
475 | 475 | foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) { |
476 | - if ( 'hidden' == $field_args['type'] ) { |
|
476 | + if ( 'hidden' == $field_args[ 'type' ] ) { |
|
477 | 477 | |
478 | 478 | // Save rendering for after the metabox |
479 | 479 | $this->add_hidden_field( $field_args, $field_group ); |
480 | 480 | |
481 | 481 | } else { |
482 | 482 | |
483 | - $field_args['show_names'] = $field_group->args( 'show_names' ); |
|
484 | - $field_args['context'] = $field_group->args( 'context' ); |
|
483 | + $field_args[ 'show_names' ] = $field_group->args( 'show_names' ); |
|
484 | + $field_args[ 'context' ] = $field_group->args( 'context' ); |
|
485 | 485 | |
486 | 486 | $field = $this->get_field( $field_args, $field_group )->render_field(); |
487 | 487 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | * @param CMB2_Field|null $field_group CMB2_Field group field object |
511 | 511 | */ |
512 | 512 | public function add_hidden_field( $field_args, $field_group = null ) { |
513 | - if ( isset( $field_args['field_args'] ) ) { |
|
513 | + if ( isset( $field_args[ 'field_args' ] ) ) { |
|
514 | 514 | // For back-compatibility. |
515 | 515 | $field = new CMB2_Field( $field_args ); |
516 | 516 | } else { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $type->iterator = $field_group->index; |
524 | 524 | } |
525 | 525 | |
526 | - $this->hidden_fields[] = $type; |
|
526 | + $this->hidden_fields[ ] = $type; |
|
527 | 527 | |
528 | 528 | return $field; |
529 | 529 | } |
@@ -626,11 +626,11 @@ discard block |
||
626 | 626 | */ |
627 | 627 | public function process_field( $field_args ) { |
628 | 628 | |
629 | - switch ( $field_args['type'] ) { |
|
629 | + switch ( $field_args[ 'type' ] ) { |
|
630 | 630 | |
631 | 631 | case 'group': |
632 | 632 | if ( $this->save_group( $field_args ) ) { |
633 | - $this->updated[] = $field_args['id']; |
|
633 | + $this->updated[ ] = $field_args[ 'id' ]; |
|
634 | 634 | } |
635 | 635 | |
636 | 636 | break; |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $field = $this->get_new_field( $field_args ); |
645 | 645 | |
646 | 646 | if ( $field->save_field_from_data( $this->data_to_save ) ) { |
647 | - $this->updated[] = $field->id(); |
|
647 | + $this->updated[ ] = $field->id(); |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | break; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | * @return mixed Return of CMB2_Field::update_data() |
712 | 712 | */ |
713 | 713 | public function save_group( $args ) { |
714 | - if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) { |
|
714 | + if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) { |
|
715 | 715 | return; |
716 | 716 | } |
717 | 717 | |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | $field_group->data_to_save = $this->data_to_save; |
741 | 741 | |
742 | 742 | foreach ( array_values( $field_group->fields() ) as $field_args ) { |
743 | - if ( 'title' === $field_args['type'] ) { |
|
743 | + if ( 'title' === $field_args[ 'type' ] ) { |
|
744 | 744 | // Don't process title fields |
745 | 745 | continue; |
746 | 746 | } |
@@ -763,16 +763,16 @@ discard block |
||
763 | 763 | $_new_val = array(); |
764 | 764 | foreach ( $new_val as $group_index => $grouped_data ) { |
765 | 765 | // Add the supporting data to the $saved array stack |
766 | - $saved[ $field_group->index ][ $grouped_data['supporting_field_id'] ][] = $grouped_data['supporting_field_value']; |
|
766 | + $saved[ $field_group->index ][ $grouped_data[ 'supporting_field_id' ] ][ ] = $grouped_data[ 'supporting_field_value' ]; |
|
767 | 767 | // Reset var to the actual value |
768 | - $_new_val[ $group_index ] = $grouped_data['value']; |
|
768 | + $_new_val[ $group_index ] = $grouped_data[ 'value' ]; |
|
769 | 769 | } |
770 | 770 | $new_val = $_new_val; |
771 | 771 | } else { |
772 | 772 | // Add the supporting data to the $saved array stack |
773 | - $saved[ $field_group->index ][ $new_val['supporting_field_id'] ] = $new_val['supporting_field_value']; |
|
773 | + $saved[ $field_group->index ][ $new_val[ 'supporting_field_id' ] ] = $new_val[ 'supporting_field_value' ]; |
|
774 | 774 | // Reset var to the actual value |
775 | - $new_val = $new_val['value']; |
|
775 | + $new_val = $new_val[ 'value' ]; |
|
776 | 776 | } |
777 | 777 | } |
778 | 778 | |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | |
787 | 787 | // Compare values and add to `$updated` array |
788 | 788 | if ( $is_updated || $is_removed ) { |
789 | - $this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id; |
|
789 | + $this->updated[ ] = $base_id . '::' . $field_group->index . '::' . $sub_id; |
|
790 | 790 | } |
791 | 791 | |
792 | 792 | // Add to `$saved` array |
@@ -823,22 +823,22 @@ discard block |
||
823 | 823 | // Try to get our object ID from the global space |
824 | 824 | switch ( $this->object_type() ) { |
825 | 825 | case 'user': |
826 | - $object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id; |
|
827 | - $object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id; |
|
826 | + $object_id = isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id; |
|
827 | + $object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS[ 'user_ID' ] ) ? $GLOBALS[ 'user_ID' ] : $object_id; |
|
828 | 828 | break; |
829 | 829 | |
830 | 830 | case 'comment': |
831 | - $object_id = isset( $_REQUEST['c'] ) ? $_REQUEST['c'] : $object_id; |
|
832 | - $object_id = ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ? $GLOBALS['comments']->comment_ID : $object_id; |
|
831 | + $object_id = isset( $_REQUEST[ 'c' ] ) ? $_REQUEST[ 'c' ] : $object_id; |
|
832 | + $object_id = ! $object_id && isset( $GLOBALS[ 'comments' ]->comment_ID ) ? $GLOBALS[ 'comments' ]->comment_ID : $object_id; |
|
833 | 833 | break; |
834 | 834 | |
835 | 835 | case 'term': |
836 | - $object_id = isset( $_REQUEST['tag_ID'] ) ? $_REQUEST['tag_ID'] : $object_id; |
|
836 | + $object_id = isset( $_REQUEST[ 'tag_ID' ] ) ? $_REQUEST[ 'tag_ID' ] : $object_id; |
|
837 | 837 | break; |
838 | 838 | |
839 | 839 | default: |
840 | - $object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id; |
|
841 | - $object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id; |
|
840 | + $object_id = isset( $GLOBALS[ 'post' ]->ID ) ? $GLOBALS[ 'post' ]->ID : $object_id; |
|
841 | + $object_id = isset( $_REQUEST[ 'post' ] ) ? $_REQUEST[ 'post' ] : $object_id; |
|
842 | 842 | break; |
843 | 843 | } |
844 | 844 | |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | * @return boolean True/False |
910 | 910 | */ |
911 | 911 | public function is_options_page_mb() { |
912 | - 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'] ) ); |
|
912 | + 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' ] ) ); |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | /** |
@@ -953,8 +953,8 @@ discard block |
||
953 | 953 | $type = 'term'; |
954 | 954 | } |
955 | 955 | |
956 | - if ( $pagenow === 'admin-ajax.php' && isset($_POST['action']) ) { |
|
957 | - switch ( $_POST['action'] ) { |
|
956 | + if ( $pagenow === 'admin-ajax.php' && isset( $_POST[ 'action' ] ) ) { |
|
957 | + switch ( $_POST[ 'action' ] ) { |
|
958 | 958 | case 'add-tag': |
959 | 959 | $type = 'term'; |
960 | 960 | break; |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | return $field; |
1005 | 1005 | } |
1006 | 1006 | |
1007 | - $field_id = is_string( $field ) ? $field : $field['id']; |
|
1007 | + $field_id = is_string( $field ) ? $field : $field[ 'id' ]; |
|
1008 | 1008 | |
1009 | 1009 | $parent_field_id = ! empty( $field_group ) ? $field_group->id() : ''; |
1010 | 1010 | $ids = $this->get_field_ids( $field_id, $parent_field_id ); |
@@ -1040,16 +1040,16 @@ discard block |
||
1040 | 1040 | if ( $field_group && ( $sub_field_id || 0 === $sub_field_id ) ) { |
1041 | 1041 | |
1042 | 1042 | // Update the fields array w/ any modified properties inherited from the group field |
1043 | - $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] = $field_args; |
|
1043 | + $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] = $field_args; |
|
1044 | 1044 | |
1045 | 1045 | return $this->get_default_args( $field_args, $field_group ); |
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | if ( is_array( $field_args ) ) { |
1049 | - $this->meta_box['fields'][ $field_id ] = array_merge( $field_args, $this->meta_box['fields'][ $field_id ] ); |
|
1049 | + $this->meta_box[ 'fields' ][ $field_id ] = array_merge( $field_args, $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1050 | 1050 | } |
1051 | 1051 | |
1052 | - return $this->get_default_args( $this->meta_box['fields'][ $field_id ] ); |
|
1052 | + return $this->get_default_args( $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | /** |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | $sub_fields = false; |
1101 | 1101 | if ( array_key_exists( 'fields', $field ) ) { |
1102 | - $sub_fields = $field['fields']; |
|
1103 | - unset( $field['fields'] ); |
|
1102 | + $sub_fields = $field[ 'fields' ]; |
|
1103 | + unset( $field[ 'fields' ] ); |
|
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | $field_id = $parent_field_id |
@@ -1125,26 +1125,26 @@ discard block |
||
1125 | 1125 | return false; |
1126 | 1126 | } |
1127 | 1127 | |
1128 | - if ( 'oembed' === $field['type'] ) { |
|
1128 | + if ( 'oembed' === $field[ 'type' ] ) { |
|
1129 | 1129 | // Initiate oembed Ajax hooks |
1130 | 1130 | cmb2_ajax(); |
1131 | 1131 | } |
1132 | 1132 | |
1133 | - if ( isset( $field['column'] ) && false !== $field['column'] ) { |
|
1133 | + if ( isset( $field[ 'column' ] ) && false !== $field[ 'column' ] ) { |
|
1134 | 1134 | $field = $this->define_field_column( $field ); |
1135 | 1135 | } |
1136 | 1136 | |
1137 | - if ( isset( $field['taxonomy'] ) && ! empty( $field['remove_default'] ) ) { |
|
1138 | - $this->tax_metaboxes_to_remove[ $field['taxonomy'] ] = $field['taxonomy']; |
|
1137 | + if ( isset( $field[ 'taxonomy' ] ) && ! empty( $field[ 'remove_default' ] ) ) { |
|
1138 | + $this->tax_metaboxes_to_remove[ $field[ 'taxonomy' ] ] = $field[ 'taxonomy' ]; |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | $this->_add_field_to_array( |
1142 | 1142 | $field, |
1143 | - $this->meta_box['fields'], |
|
1143 | + $this->meta_box[ 'fields' ], |
|
1144 | 1144 | $position |
1145 | 1145 | ); |
1146 | 1146 | |
1147 | - return $field['id']; |
|
1147 | + return $field[ 'id' ]; |
|
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | /** |
@@ -1156,10 +1156,10 @@ discard block |
||
1156 | 1156 | protected function define_field_column( array $field ) { |
1157 | 1157 | $this->has_columns = true; |
1158 | 1158 | |
1159 | - $column = is_array( $field['column'] ) ? $field['column'] : array(); |
|
1159 | + $column = is_array( $field[ 'column' ] ) ? $field[ 'column' ] : array(); |
|
1160 | 1160 | |
1161 | - $field['column'] = wp_parse_args( $column, array( |
|
1162 | - 'name' => isset( $field['name'] ) ? $field['name'] : '', |
|
1161 | + $field[ 'column' ] = wp_parse_args( $column, array( |
|
1162 | + 'name' => isset( $field[ 'name' ] ) ? $field[ 'name' ] : '', |
|
1163 | 1163 | 'position' => false, |
1164 | 1164 | ) ); |
1165 | 1165 | |
@@ -1175,27 +1175,27 @@ discard block |
||
1175 | 1175 | * @return mixed Array of parent/field ids or false |
1176 | 1176 | */ |
1177 | 1177 | public function add_group_field( $parent_field_id, array $field, $position = 0 ) { |
1178 | - if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) { |
|
1178 | + if ( ! array_key_exists( $parent_field_id, $this->meta_box[ 'fields' ] ) ) { |
|
1179 | 1179 | return false; |
1180 | 1180 | } |
1181 | 1181 | |
1182 | - $parent_field = $this->meta_box['fields'][ $parent_field_id ]; |
|
1182 | + $parent_field = $this->meta_box[ 'fields' ][ $parent_field_id ]; |
|
1183 | 1183 | |
1184 | - if ( 'group' !== $parent_field['type'] ) { |
|
1184 | + if ( 'group' !== $parent_field[ 'type' ] ) { |
|
1185 | 1185 | return false; |
1186 | 1186 | } |
1187 | 1187 | |
1188 | - if ( ! isset( $parent_field['fields'] ) ) { |
|
1189 | - $this->meta_box['fields'][ $parent_field_id ]['fields'] = array(); |
|
1188 | + if ( ! isset( $parent_field[ 'fields' ] ) ) { |
|
1189 | + $this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ] = array(); |
|
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | $this->_add_field_to_array( |
1193 | 1193 | $field, |
1194 | - $this->meta_box['fields'][ $parent_field_id ]['fields'], |
|
1194 | + $this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ], |
|
1195 | 1195 | $position |
1196 | 1196 | ); |
1197 | 1197 | |
1198 | - return array( $parent_field_id, $field['id'] ); |
|
1198 | + return array( $parent_field_id, $field[ 'id' ] ); |
|
1199 | 1199 | } |
1200 | 1200 | |
1201 | 1201 | /** |
@@ -1207,9 +1207,9 @@ discard block |
||
1207 | 1207 | */ |
1208 | 1208 | protected function _add_field_to_array( $field, &$fields, $position = 0 ) { |
1209 | 1209 | if ( $position ) { |
1210 | - CMB2_Utils::array_insert( $fields, array( $field['id'] => $field ), $position ); |
|
1210 | + CMB2_Utils::array_insert( $fields, array( $field[ 'id' ] => $field ), $position ); |
|
1211 | 1211 | } else { |
1212 | - $fields[ $field['id'] ] = $field; |
|
1212 | + $fields[ $field[ 'id' ] ] = $field; |
|
1213 | 1213 | } |
1214 | 1214 | } |
1215 | 1215 | |
@@ -1232,15 +1232,15 @@ discard block |
||
1232 | 1232 | unset( $this->fields[ implode( '', $ids ) ] ); |
1233 | 1233 | |
1234 | 1234 | if ( ! $sub_field_id ) { |
1235 | - unset( $this->meta_box['fields'][ $field_id ] ); |
|
1235 | + unset( $this->meta_box[ 'fields' ][ $field_id ] ); |
|
1236 | 1236 | return true; |
1237 | 1237 | } |
1238 | 1238 | |
1239 | - if ( isset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ) ) { |
|
1240 | - unset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ); |
|
1239 | + if ( isset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] ) ) { |
|
1240 | + unset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] ); |
|
1241 | 1241 | } |
1242 | - if ( isset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ) ) { |
|
1243 | - unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ); |
|
1242 | + if ( isset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] ) ) { |
|
1243 | + unset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] ); |
|
1244 | 1244 | } |
1245 | 1245 | return true; |
1246 | 1246 | } |
@@ -1264,11 +1264,11 @@ discard block |
||
1264 | 1264 | list( $field_id, $sub_field_id ) = $ids; |
1265 | 1265 | |
1266 | 1266 | if ( ! $sub_field_id ) { |
1267 | - $this->meta_box['fields'][ $field_id ][ $property ] = $value; |
|
1267 | + $this->meta_box[ 'fields' ][ $field_id ][ $property ] = $value; |
|
1268 | 1268 | return $field_id; |
1269 | 1269 | } |
1270 | 1270 | |
1271 | - $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value; |
|
1271 | + $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ][ $property ] = $value; |
|
1272 | 1272 | return $field_id; |
1273 | 1273 | } |
1274 | 1274 | |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | public function get_field_ids( $field_id, $parent_field_id = '' ) { |
1283 | 1283 | $sub_field_id = $parent_field_id ? $field_id : ''; |
1284 | 1284 | $field_id = $parent_field_id ? $parent_field_id : $field_id; |
1285 | - $fields =& $this->meta_box['fields']; |
|
1285 | + $fields = & $this->meta_box[ 'fields' ]; |
|
1286 | 1286 | |
1287 | 1287 | if ( ! array_key_exists( $field_id, $fields ) ) { |
1288 | 1288 | $field_id = $this->search_old_school_array( $field_id, $fields ); |
@@ -1296,12 +1296,12 @@ discard block |
||
1296 | 1296 | return array( $field_id, $sub_field_id ); |
1297 | 1297 | } |
1298 | 1298 | |
1299 | - if ( 'group' !== $fields[ $field_id ]['type'] ) { |
|
1299 | + if ( 'group' !== $fields[ $field_id ][ 'type' ] ) { |
|
1300 | 1300 | return false; |
1301 | 1301 | } |
1302 | 1302 | |
1303 | - if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) { |
|
1304 | - $sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] ); |
|
1303 | + if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ][ 'fields' ] ) ) { |
|
1304 | + $sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ][ 'fields' ] ); |
|
1305 | 1305 | } |
1306 | 1306 | |
1307 | 1307 | return false === $sub_field_id ? false : array( $field_id, $sub_field_id ); |