| @@ -1,20 +1,14 @@ | ||
| 1 | -<?php | |
| 1 | +<?php if ( ! defined( 'ABSPATH' ) ) { | |
| 2 | + die; } // Cannot access directly. | |
| 2 | 3 | /** |
| 3 | - * The framework radio fields file. | |
| 4 | 4 | * |
| 5 | - * @package Smart_Post_Show | |
| 6 | - * @subpackage Smart_Post_Show/admin | |
| 5 | + * Field: radio | |
| 6 | + * | |
| 7 | + * @since 1.0.0 | |
| 8 | + * @version 1.0.0 | |
| 7 | 9 | */ |
| 8 | - | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | - die; | |
| 11 | -} // Cannot access directly. | |
| 12 | - | |
| 13 | 10 | if ( ! class_exists( 'SP_PC_Field_radio' ) ) { |
| 14 | - /** | |
| 15 | - * SP_PC_Field_radio | |
| 16 | - */ | |
| 17 | 11 | class SP_PC_Field_radio extends SP_PC_Fields { |
| 18 | 12 | |
| 19 | 13 | /** |
| 20 | 14 | * The radio field constructor. |
| @@ -45,9 +39,9 @@ | ||
| 45 | 39 | ); |
| 46 | 40 | |
| 47 | 41 | $inline_class = ( $args['inline'] ) ? ' class="spf--inline-list"' : ''; |
| 48 | 42 | |
| 49 | - echo wp_kses_post( $this->field_before() ); | |
| 43 | + echo $this->field_before(); | |
| 50 | 44 | |
| 51 | 45 | if ( isset( $this->field['options'] ) ) { |
| 52 | 46 | |
| 53 | 47 | $options = $this->field['options']; |
| @@ -54,9 +48,9 @@ | ||
| 54 | 48 | $options = ( is_array( $options ) ) ? $options : array_filter( $this->field_data( $options, false, $args['query_args'] ) ); |
| 55 | 49 | |
| 56 | 50 | if ( is_array( $options ) && ! empty( $options ) ) { |
| 57 | 51 | |
| 58 | - echo '<ul' . wp_kses_post( $inline_class ) . '>'; | |
| 52 | + echo '<ul' . $inline_class . '>'; | |
| 59 | 53 | foreach ( $options as $option_key => $pcp_metabox_value ) { |
| 60 | 54 | |
| 61 | 55 | if ( is_array( $pcp_metabox_value ) && ! empty( $pcp_metabox_value ) ) { |
| 62 | 56 | |
| @@ -61,12 +55,12 @@ | ||
| 61 | 55 | if ( is_array( $pcp_metabox_value ) && ! empty( $pcp_metabox_value ) ) { |
| 62 | 56 | |
| 63 | 57 | echo '<li>'; |
| 64 | 58 | echo '<ul>'; |
| 65 | - echo '<li><strong>' . esc_html( $option_key ) . '</strong></li>'; | |
| 59 | + echo '<li><strong>' . $option_key . '</strong></li>'; | |
| 66 | 60 | foreach ( $pcp_metabox_value as $sub_key => $sub_value ) { |
| 67 | 61 | $checked = ( $sub_key == $this->value ) ? ' checked' : ''; |
| 68 | - echo '<li><label><input type="radio" name="' . esc_attr( $this->field_name() ) . '" value="' . esc_attr( $sub_key ) . '"' . wp_kses_post( $this->field_attributes() ) . esc_attr( $checked ) . '/> ' . wp_kses_post( $sub_value ) . '</label></li>'; | |
| 62 | + echo '<li><label><input type="radio" name="' . $this->field_name() . '" value="' . $sub_key . '"' . $this->field_attributes() . $checked . '/> ' . $sub_value . '</label></li>'; | |
| 69 | 63 | } |
| 70 | 64 | echo '</ul>'; |
| 71 | 65 | echo '</li>'; |
| 72 | 66 | |
| @@ -72,9 +66,9 @@ | ||
| 72 | 66 | |
| 73 | 67 | } else { |
| 74 | 68 | |
| 75 | 69 | $checked = ( $option_key == $this->value ) ? ' checked' : ''; |
| 76 | - echo '<li><label><input type="radio" name="' . esc_attr( $this->field_name() ) . '" value="' . esc_attr( $option_key ) . '"' . wp_kses_post( $this->field_attributes() ) . esc_attr( $checked ) . '/> ' . esc_html( $pcp_metabox_value ) . '</label></li>'; | |
| 70 | + echo '<li><label><input type="radio" name="' . $this->field_name() . '" value="' . $option_key . '"' . $this->field_attributes() . $checked . '/> ' . $pcp_metabox_value . '</label></li>'; | |
| 77 | 71 | |
| 78 | 72 | } |
| 79 | 73 | } |
| 80 | 74 | echo '</ul>'; |
| @@ -80,16 +74,18 @@ | ||
| 80 | 74 | echo '</ul>'; |
| 81 | 75 | |
| 82 | 76 | } else { |
| 83 | 77 | |
| 84 | - echo ( esc_html( ! empty( $this->field['empty_message'] ) ) ) ? esc_html( $this->field['empty_message'] ) : esc_html__( 'No data provided for this option type.', 'post-carousel' ); | |
| 78 | + echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'smart-post-show' ); | |
| 85 | 79 | |
| 86 | 80 | } |
| 87 | 81 | } else { |
| 88 | 82 | $label = ( isset( $this->field['label'] ) ) ? $this->field['label'] : ''; |
| 89 | - echo '<label><input type="radio" name="' . esc_attr( $this->field_name() ) . '" value="1"' . wp_kses_post( $this->field_attributes() . checked( $this->value, 1, false ) ) . '/> ' . esc_html( $label ) . '</label>'; | |
| 83 | + echo '<label><input type="radio" name="' . $this->field_name() . '" value="1"' . $this->field_attributes() . checked( $this->value, 1, false ) . '/> ' . $label . '</label>'; | |
| 90 | 84 | } |
| 91 | 85 | |
| 92 | - echo wp_kses_post( $this->field_after() ); | |
| 86 | + echo $this->field_after(); | |
| 87 | + | |
| 93 | 88 | } |
| 89 | + | |
| 94 | 90 | } |
| 95 | 91 | } |