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 $o ) { $children[$o->$parent][] = $o; } $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; $meta = $this->meta; $walker = new MASHSB_RWMB_Select_Walker( $this->db_fields, $this->field, $this->meta ); $field_class = MASHSB_RW_Meta_Box::get_class_name( $field ); $attributes = call_user_func( array( $field_class, 'get_attributes' ), $field, $meta ); $children = $options[$parent_id]; $output = sprintf( '