| @@ -8,25 +8,13 @@ | ||
| 8 | 8 | * @version 1.0.0 |
| 9 | 9 | */ |
| 10 | 10 | if ( ! class_exists( 'SP_PC_Fields_upload' ) ) { |
| 11 | 11 | class SP_PC_Fields_upload extends SP_PC_Fields { |
| 12 | - /** | |
| 13 | - * Class constructor. | |
| 14 | - * | |
| 15 | - * @param [type] $field | |
| 16 | - * @param string $value | |
| 17 | - * @param string $unique | |
| 18 | - * @param string $where | |
| 19 | - * @param string $parent | |
| 20 | - */ | |
| 12 | + | |
| 21 | 13 | public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { |
| 22 | 14 | parent::__construct( $field, $value, $unique, $where, $parent ); |
| 23 | 15 | } |
| 24 | - /** | |
| 25 | - * The render method. | |
| 26 | - * | |
| 27 | - * @return void | |
| 28 | - */ | |
| 16 | + | |
| 29 | 17 | public function render() { |
| 30 | 18 | |
| 31 | 19 | $args = wp_parse_args( |
| 32 | 20 | $this->field, |
| @@ -36,9 +24,9 @@ | ||
| 36 | 24 | 'remove_title' => esc_html__( 'Remove', 'smart-post-show' ), |
| 37 | 25 | ) |
| 38 | 26 | ); |
| 39 | 27 | |
| 40 | - echo wp_kses_post( $this->field_before() ); | |
| 28 | + echo $this->field_before(); | |
| 41 | 29 | |
| 42 | 30 | $library = ( is_array( $args['library'] ) ) ? $args['library'] : array_filter( (array) $args['library'] ); |
| 43 | 31 | $library = ( ! empty( $library ) ) ? implode( ',', $library ) : ''; |
| 44 | 32 | $hidden = ( empty( $this->value ) ) ? ' hidden' : ''; |
| @@ -43,14 +31,14 @@ | ||
| 43 | 31 | $library = ( ! empty( $library ) ) ? implode( ',', $library ) : ''; |
| 44 | 32 | $hidden = ( empty( $this->value ) ) ? ' hidden' : ''; |
| 45 | 33 | |
| 46 | 34 | echo '<div class="spf--wrap">'; |
| 47 | - echo '<input type="text" name="' . esc_attr( $this->field_name() ) . '" value="' . esc_attr( $this->value ) . '"' . wp_kses_post( $this->field_attributes() ) . '/>'; | |
| 48 | - echo '<a href="#" class="button button-primary spf--button" data-library="' . esc_attr( $library ) . '">' . esc_html( $args['button_title'] ) . '</a>'; | |
| 49 | - echo '<a href="#" class="button button-secondary spf-warning-primary spf--remove' . esc_attr( $hidden ) . '">' . esc_html( $args['remove_title'] ) . '</a>'; | |
| 35 | + echo '<input type="text" name="' . $this->field_name() . '" value="' . $this->value . '"' . $this->field_attributes() . '/>'; | |
| 36 | + echo '<a href="#" class="button button-primary spf--button" data-library="' . esc_attr( $library ) . '">' . $args['button_title'] . '</a>'; | |
| 37 | + echo '<a href="#" class="button button-secondary spf-warning-primary spf--remove' . $hidden . '">' . $args['remove_title'] . '</a>'; | |
| 50 | 38 | echo '</div>'; |
| 51 | 39 | |
| 52 | - echo wp_kses_post( $this->field_after() ); | |
| 40 | + echo $this->field_after(); | |
| 53 | 41 | |
| 54 | 42 | } |
| 55 | 43 | } |
| 56 | 44 | } |