diff --git a/changelog.txt b/changelog.txt index 884d24116db638f5dafcea028b661ebd754e7bcc..6d3569dbf3b7092e044d318429752aad71167d66 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,14 @@ # Changelog +## [3.2.0] - 2023-03-16 +### Added +- WPEditorField +- DateField +### Deprecated +- WyswigField +### Fixed +- Removed sanitizing from sublabel + ## [3.1.0] - 2022-08-30 ### Added - de_DE translations diff --git a/src/Field/DateField.php b/src/Field/DateField.php index b5c11f7d84480906339b52595e4fd388c11d5ae5..58346dae1ed4b571bc1d050b63601fd3b39089fb 100644 --- a/src/Field/DateField.php +++ b/src/Field/DateField.php @@ -7,15 +7,14 @@ use WPDesk\Forms\Sanitizer\TextFieldSanitizer; class DateField extends BasicField { public function __construct() { - parent::__construct(); $this->set_placeholder('YYYY-MM-DD'); } - public function get_type() { + public function get_type(): string { return 'date'; } - public function get_template_name() { + public function get_template_name(): string { return 'input-text'; } diff --git a/templates/input-text-multiple.php b/templates/input-text-multiple.php index 05e7d29abd4d8744cdffef854dd7ecff536825f1..4caa54e9748d7b77c503357175b6fdf7bcc756f3 100644 --- a/templates/input-text-multiple.php +++ b/templates/input-text-multiple.php @@ -57,7 +57,7 @@ if ( empty( $value ) || is_string( $value ) ) { </div> <?php if ( $field->get_type() === 'checkbox' && $field->has_sublabel() ) : ?> - <?php echo \esc_html( $field->get_sublabel() ); ?></label> + <?php echo wp_kses_post( $field->get_sublabel() ); ?></label> <?php endif; ?> <?php endforeach; ?> </div> diff --git a/templates/input.php b/templates/input.php index 4b8eb6a5bc3c3e485e51a07ed8e1107a8d053ac2..29b1484e299f7140192430aedace11115b304a76 100644 --- a/templates/input.php +++ b/templates/input.php @@ -39,5 +39,5 @@ if ( $field->get_type() === 'checkbox' && $field->has_sublabel() ) : /> <?php if ( $field->get_type() === 'checkbox' && $field->has_sublabel() ) : ?> - <?php echo \esc_html( $field->get_sublabel() ); ?></label> + <?php echo wp_kses_post( $field->get_sublabel() ); ?></label> <?php endif; ?> diff --git a/templates/wp-editor.php b/templates/wp-editor.php index 4554274b37de7a70a92dc8de5a84141440db892a..90576aa779361a91ab35c22ff785e8d268992a94 100644 --- a/templates/wp-editor.php +++ b/templates/wp-editor.php @@ -8,7 +8,7 @@ wp_print_styles( 'media-views' ); $default_settings = [ - 'textarea_name' => esc_attr( $name_prefix ) . '[' . esc_attr( $this->get_name() ) . ']', + 'textarea_name' => esc_attr( $name_prefix ) . '[' . esc_attr( $field->get_name() ) . ']', 'tinymce' => [ 'toolbar1' => 'bold,italic,underline,separator,alignleft,aligncenter,alignright,separator,link,unlink,undo,redo', 'toolbar2' => '',