', self::render_attributes( $attributes ) ); if ( ! $field['multiple'] && $field['placeholder'] ) { $output .= ''; } $output .= $walker->walk( $options, $field['flatten'] ? -1 : 0 ); $output .= ''; $output .= self::get_select_all_html( $field ); return $output; } /** * Normalize parameters for field. * * @param array $field Field parameters. * @return array */ public static function normalize( $field ) { $field = parent::normalize( $field ); $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field; $field = wp_parse_args( $field, [ 'select_all_none' => false, ] ); return $field; } /** * Get the attributes for a field. * * @param array $field Field parameters. * @param mixed $value Meta value. * * @return array */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); $attributes = wp_parse_args( $attributes, [ 'multiple' => $field['multiple'], ] ); return $attributes; } /** * Get html for select all|none for multiple select. * * @param array $field Field parameters. * @return string */ public static function get_select_all_html( $field ) { if ( $field['multiple'] && $field['select_all_none'] ) { return '