diff --git a/changelog.md b/changelog.md index 74644f3..2c6e62e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,16 @@ # Modern Changelog +## 2.2.2 + +* **Fix**: Theme options sanitization + +### Files changed: + + changelog.md + style.css + includes/customize/class-customize.php + + ## 2.2.1 * **Fix**: Blog page excerpt display diff --git a/includes/customize/class-customize.php b/includes/customize/class-customize.php index 70aebb8..2c4689d 100644 --- a/includes/customize/class-customize.php +++ b/includes/customize/class-customize.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.2.0 + * @version 2.2.2 * * Contents: * @@ -252,7 +252,7 @@ public static function option_pointer_texts_intro( $title ) { * Set theme options array * * @since 2.0.0 - * @version 2.2.0 + * @version 2.2.2 * * @param array $options */ @@ -293,18 +293,18 @@ public static function options( $options = array() ) { ), '0' . 10 . 'logo' . 20 => array( - 'section' => 'title_tagline', - 'priority' => 102, - 'type' => 'text', - 'id' => 'custom_logo_height', - 'label' => esc_html__( 'Max logo image height (px)', 'modern' ), - 'default' => 100, - 'validate' => 'absint', - 'input_attrs' => array( + 'section' => 'title_tagline', + 'priority' => 102, + 'type' => 'text', + 'id' => 'custom_logo_height', + 'label' => esc_html__( 'Max logo image height (px)', 'modern' ), + 'default' => 100, + 'sanitize_callback' => 'absint', + 'input_attrs' => array( 'size' => 5, 'maxwidth' => 3, ), - 'preview_js' => array( + 'preview_js' => array( 'custom' => "jQuery( '.custom-logo' ).css( 'max-height', to + 'px' );", ), ), @@ -791,26 +791,26 @@ public static function options( $options = array() ) { ), 800 . 'texts' . 100 => array( - 'type' => 'textarea', - 'id' => 'texts_intro', - 'label' => esc_html__( 'Default blog intro text', 'modern' ), - 'description' => esc_html__( 'This text will be displayed in intro section of your website front page only if latest posts are displayed there.', 'modern' ), - 'default' => esc_html__( 'Welcome to our site!', 'modern' ), - 'validate' => 'wp_kses_post', - 'preview_js' => array( + 'type' => 'textarea', + 'id' => 'texts_intro', + 'label' => esc_html__( 'Default blog intro text', 'modern' ), + 'description' => esc_html__( 'This text will be displayed in intro section of your website front page only if latest posts are displayed there.', 'modern' ), + 'default' => esc_html__( 'Welcome to our site!', 'modern' ), + 'sanitize_callback' => 'wp_kses_post', + 'preview_js' => array( 'custom' => "jQuery( '.home.blog .intro-title' ).html( '' + to ); if ( '' === to ) { jQuery( '.home.blog .intro-title' ).hide(); } else { jQuery( '.home.blog .intro-title:hidden' ).show(); }", ), - 'active_callback' => __CLASS__ . '::is_blog_front_page', + 'active_callback' => __CLASS__ . '::is_blog_front_page', ), 800 . 'texts' . 500 => array( - 'type' => 'textarea', - 'id' => 'texts_site_info', - 'label' => esc_html__( 'Footer credits (copyright)', 'modern' ), - 'description' => sprintf( esc_html__( 'Set %s to disable this area.', 'modern' ), '-' ) . ' ' . esc_html__( 'Leaving the field empty will fall back to default theme setting.', 'modern' ) . ' ' . sprintf( esc_html__( 'You can use %s to display dynamic, always current year.', 'modern' ), '[year]' ), - 'default' => '', - 'validate' => 'wp_kses_post', - 'preview_js' => array( + 'type' => 'textarea', + 'id' => 'texts_site_info', + 'label' => esc_html__( 'Footer credits (copyright)', 'modern' ), + 'description' => sprintf( esc_html__( 'Set %s to disable this area.', 'modern' ), '-' ) . ' ' . esc_html__( 'Leaving the field empty will fall back to default theme setting.', 'modern' ) . ' ' . sprintf( esc_html__( 'You can use %s to display dynamic, always current year.', 'modern' ), '[year]' ), + 'default' => '', + 'sanitize_callback' => 'wp_kses_post', + 'preview_js' => array( 'custom' => "jQuery( '.site-info' ).html( to ); if ( '-' === to ) { jQuery( '.footer-area-site-info' ).hide(); } else { jQuery( '.footer-area-site-info:hidden' ).show(); }", ), ), @@ -828,17 +828,17 @@ public static function options( $options = array() ) { ), 900 . 'typography' . 100 => array( - 'type' => 'range', - 'id' => 'typography_size_html', - 'label' => esc_html__( 'Basic font size in px', 'modern' ), - 'description' => esc_html__( 'All other font sizes are calculated automatically from this basic font size.', 'modern' ), - 'default' => 16, - 'min' => 12, - 'max' => 24, - 'step' => 1, - 'suffix' => 'px', - 'validate' => 'absint', - 'preview_js' => array( + 'type' => 'range', + 'id' => 'typography_size_html', + 'label' => esc_html__( 'Basic font size in px', 'modern' ), + 'description' => esc_html__( 'All other font sizes are calculated automatically from this basic font size.', 'modern' ), + 'default' => 16, + 'min' => 12, + 'max' => 24, + 'step' => 1, + 'suffix' => 'px', + 'sanitize_callback' => 'absint', + 'preview_js' => array( 'css' => array( 'html' => array( @@ -875,39 +875,39 @@ public static function options( $options = array() ) { ), 900 . 'typography' . 220 => array( - 'type' => 'text', - 'id' => 'typography_fonts_text', - 'label' => esc_html__( 'General text font', 'modern' ), - 'default' => "'Fira Sans', sans-serif", - 'input_attrs' => array( + 'type' => 'text', + 'id' => 'typography_fonts_text', + 'label' => esc_html__( 'General text font', 'modern' ), + 'default' => "'Fira Sans', sans-serif", + 'input_attrs' => array( 'placeholder' => "'Fira Sans', sans-serif", ), - 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', - 'validate' => 'Modern_Library_Sanitize::fonts', + 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', + 'sanitize_callback' => 'Modern_Library_Sanitize::fonts', ), 900 . 'typography' . 230 => array( - 'type' => 'text', - 'id' => 'typography_fonts_headings', - 'label' => esc_html__( 'Headings font', 'modern' ), - 'default' => "'Fira Sans', sans-serif", - 'input_attrs' => array( + 'type' => 'text', + 'id' => 'typography_fonts_headings', + 'label' => esc_html__( 'Headings font', 'modern' ), + 'default' => "'Fira Sans', sans-serif", + 'input_attrs' => array( 'placeholder' => "'Fira Sans', sans-serif", ), - 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', - 'validate' => 'Modern_Library_Sanitize::fonts', + 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', + 'sanitize_callback' => 'Modern_Library_Sanitize::fonts', ), 900 . 'typography' . 240 => array( - 'type' => 'text', - 'id' => 'typography_fonts_logo', - 'label' => esc_html__( 'Logo font', 'modern' ), - 'default' => "'Fira Sans', sans-serif", - 'input_attrs' => array( + 'type' => 'text', + 'id' => 'typography_fonts_logo', + 'label' => esc_html__( 'Logo font', 'modern' ), + 'default' => "'Fira Sans', sans-serif", + 'input_attrs' => array( 'placeholder' => "'Fira Sans', sans-serif", ), - 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', - 'validate' => 'Modern_Library_Sanitize::fonts', + 'active_callback' => __CLASS__ . '::is_typography_custom_fonts', + 'sanitize_callback' => 'Modern_Library_Sanitize::fonts', ), 900 . 'typography' . 290 => array( diff --git a/style.css b/style.css index fecf51a..5791fb1 100644 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: Modern Theme URI: https://www.webmandesign.eu/portfolio/modern-wordpress-theme/ Author: WebMan Design Author URI: https://www.webmandesign.eu/ -Version: 2.2.1 +Version: 2.2.2 Text Domain: modern Domain Path: /languages License: GNU General Public License v3