db_fields = wp_parse_args( (array) $db_fields, array( 'parent' => '', 'id' => '', 'label' => '', ) ); $this->field = $field; $this->meta = (array) $meta; } function walk( $options ) { $parent = $this->db_fields['parent']; $children = array(); foreach ( $options as $option ) { $children[ $option->$parent ][] = $option; } $top_level = isset( $children[0] ) ? 0 : $options[0]->$parent; return $this->display_level( $children, $top_level, true ); } function display_level( $options, $parent_id = 0, $active = false ) { $id = $this->db_fields['id']; $field = $this->field; $walker = new RWMB_Walker_Select( $this->db_fields, $field, $this->meta ); $attributes = RWMB_Field::call( 'get_attributes', $field, $this->meta ); $children = $options[ $parent_id ]; $output = sprintf( '