diff --git a/inc/css-builder.php b/inc/css-builder.php index c10539ce2..681c4edf0 100644 --- a/inc/css-builder.php +++ b/inc/css-builder.php @@ -30,9 +30,9 @@ public function add_css( $selector, $attributes, $resolution = 1920 ) { if ( ! strlen( (string) $v[ $i ] ) ) continue; $attribute_string[] = wp_strip_all_tags( $k ) . ':' . wp_strip_all_tags( $v[ $i ] ); } - } - else { - if ( ! strlen( (string) $v ) ) continue; + } elseif ( ! strlen( (string) $v ) || $v == 'px' ) { + continue; + } else { $attribute_string[] = wp_strip_all_tags( $k ) . ':' . wp_strip_all_tags( $v ); } } diff --git a/inc/sidebars-emulator.php b/inc/sidebars-emulator.php index cc5eb9552..b77566fb5 100644 --- a/inc/sidebars-emulator.php +++ b/inc/sidebars-emulator.php @@ -73,9 +73,10 @@ function register_widgets() { if ( ! empty( $current_url['path'] ) ) { // Check if WPML is running. - if ( defined( 'ICL_LANGUAGE_CODE' ) ) { + $wpml_language = apply_filters( 'wpml_current_language', NULL ); + if ( ! empty( $wpml_language ) ) { // Remove the current language code from path to avoid 404. - $current_url['path'] = ltrim( $current_url['path'], '/' . ICL_LANGUAGE_CODE . '/' ); + $current_url['path'] = preg_replace( "/^\/$wpml_language\//", '/', $current_url['path'], 1 ); } $page = get_page_by_path( $current_url['path'], OBJECT, siteorigin_panels_setting( 'post-types' ) ); diff --git a/readme.txt b/readme.txt index b252aa60a..48ae5e3c6 100644 --- a/readme.txt +++ b/readme.txt @@ -107,6 +107,10 @@ SiteOrigin Premium includes access to our professional email support service, pe == Changelog == += 2.16.6 - 21 March 2022 = +* Prevented CSS properties outputting with only `px` set as the value. +* WPML: Refined sidebar emulator language path removal. + = 2.16.5 - 06 March 2022 = * Full-Width Containers Using CSS: Ensured full-width global CSS is only output once.