From e55cc26876846c233614658ec6d8fdabb837596e Mon Sep 17 00:00:00 2001 From: Marqas Date: Mon, 4 Feb 2019 17:28:39 +0530 Subject: [PATCH] #2707 #2745 Added in master --- .../includes/sanitizers/class-amp-style-sanitizer.php | 5 +++-- includes/vendor/vendor-changelog.txt | 3 ++- pagebuilder/modules/button-mod-module.php | 1 + templates/features.php | 10 +++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php b/includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php index 4f31f487c..d2ae14c45 100644 --- a/includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php +++ b/includes/vendor/amp/includes/sanitizers/class-amp-style-sanitizer.php @@ -25,15 +25,16 @@ private function collect_styles_recursive( $node ) { if ( $node->hasAttributes() && $node instanceof DOMElement ) { $style = $node->getAttribute( 'style' ); $class = $node->getAttribute( 'class' ); + $tagName = $node->tagName; if ( $style ) { $style = $this->process_style( $style ); if ( ! empty( $style ) ) { $class_name = $this->generate_class_name( $style ); $new_class = trim( $class . ' ' . $class_name ); - + $selector = $tagName.'.' . $class_name; $node->setAttribute( 'class', $new_class ); - $this->styles[ '.' . $class_name ] = $style; + $this->styles[ $selector ] = $style; } $node->removeAttribute( 'style' ); diff --git a/includes/vendor/vendor-changelog.txt b/includes/vendor/vendor-changelog.txt index 3cc810879..1f7885911 100644 --- a/includes/vendor/vendor-changelog.txt +++ b/includes/vendor/vendor-changelog.txt @@ -57,4 +57,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder 30. FTP protocol has been whitelisted in anchor tags #2477 31. Class AMP_Img_Sanitizer Updated #2748 32. Widgets folder added in Vendor amp/includes #1400 -33. Class AMP_Blacklist_Sanitizer updated #2835 \ No newline at end of file +33. Class AMP_Blacklist_Sanitizer updated #2835 +34. class-amp-style-sanitizer.php updated #2745 \ No newline at end of file diff --git a/pagebuilder/modules/button-mod-module.php b/pagebuilder/modules/button-mod-module.php index 6acb67f8e..5867630bc 100644 --- a/pagebuilder/modules/button-mod-module.php +++ b/pagebuilder/modules/button-mod-module.php @@ -69,6 +69,7 @@ 'name' =>"btn_link", 'label' =>'URL', 'tab' =>'customizer', + 'helpmessage' => esc_html__('Enter URL with Valid Protocol(http, https, mailto, sms, tel, viber, whatsapp, ftp)', 'accelerated-mobile-pages'), 'default' =>'#', 'content_type'=>'html', ), diff --git a/templates/features.php b/templates/features.php index 9c56ef2c7..512855645 100644 --- a/templates/features.php +++ b/templates/features.php @@ -7782,4 +7782,12 @@ function ampforwp_sd_feature_image_guidlines($metadata){ } return $metadata; } -} \ No newline at end of file +} +// Gutenberg Modules CSS #2707 +add_action('amp_post_template_css', 'ampforwp_gutenberg_css'); +if ( ! function_exists('ampforwp_gutenberg_css') ) { + function ampforwp_gutenberg_css(){ ?> + .wp-block-button { color: #fff} + .wp-block-button a {background-color: #32373c;border-radius: 28px;color: inherit;display: inline-block;padding: 12px 24px;} +