set( 'legend', $attr['legend'] ); unset( $attr['legend'] ); } return sprintf( '
', $this->legend(), $this->render_options( $attr ), $this->description() ); } protected function render_options( array $attr ) { if ( ! isset( $attr['options'] ) ) { $attr['options'] = []; } if ( isset( $attr['show_option_none'] ) ) { $none = is_string( $attr['show_option_none'] ) ? $attr['show_option_none'] : __( 'None', 'italystrap' ) ; $attr['options'] = [ $none ] + $attr['options']; } $html = ''; foreach ( (array) $attr['options'] as $value => $option ) { $new_attr = array_merge( $attr, [ 'id' => $attr['id'] . '_' . $value, 'value' => $value, 'checked' => $this->is_checked( $value, $attr['value'], $attr ), ] ); $this->set( 'label', $option ); $this->set( 'id', $new_attr['id'] ); unset( $new_attr['options'] ); $html .= sprintf( '