Code Duplication    Length = 15-15 lines in 2 locations

includes/class-sensei-settings-api.php 2 locations

@@ 500-514 (lines=15) @@
497
	 * @param  array $args
498
	 * @return void
499
	 */
500
	public function form_field_radio ( $args ) {
501
		$options = $this->get_settings();
502
503
		if ( isset( $args['data']['options'] ) && ( count( (array)$args['data']['options'] ) > 0 ) ) {
504
			$html = '';
505
			foreach ( $args['data']['options'] as $k => $v ) {
506
				$html .= '<input type="radio" name="' . $this->token . '[' . esc_attr( $args['key'] ) . ']" value="' . esc_attr( $k ) . '"' . checked( esc_attr( $options[$args['key']] ), $k, false ) . ' /> ' . $v . '<br />' . "\n";
507
			}
508
			echo $html;
509
510
			if ( isset( $args['data']['description'] ) ) {
511
				echo '<span class="description">' . esc_html( $args['data']['description'] ) . '</span>' . "\n";
512
			}
513
		}
514
	} // End form_field_radio()
515
516
	/**
517
	 * Generate multicheck field.
@@ 581-595 (lines=15) @@
578
	 * @param  array $args
579
	 * @return void
580
	 */
581
	public function form_field_images ( $args ) {
582
		$options = $this->get_settings();
583
584
		if ( isset( $args['data']['options'] ) && ( count( (array)$args['data']['options'] ) > 0 ) ) {
585
			$html = '';
586
			foreach ( $args['data']['options'] as $k => $v ) {
587
				$html .= '<input type="radio" name="' . esc_attr( $this->token ) . '[' . esc_attr( $args['key'] ) . ']" value="' . esc_attr( $k ) . '"' . checked( esc_attr( $options[$args['key']] ), $k, false ) . ' /> ' . $v . '<br />' . "\n";
588
			}
589
			echo $html;
590
591
			if ( isset( $args['data']['description'] ) ) {
592
				echo '<span class="description">' . esc_html( $args['data']['description'] ) . '</span>' . "\n";
593
			}
594
		}
595
	} // End form_field_images()
596
597
	/**
598
	 * Generate information box field.