Skip to content

Commit

Permalink
#2707 #2745 Added in master
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Feb 4, 2019
1 parent 8b56412 commit e55cc26
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
3 changes: 2 additions & 1 deletion includes/vendor/vendor-changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
33. Class AMP_Blacklist_Sanitizer updated #2835
34. class-amp-style-sanitizer.php updated #2745
1 change: 1 addition & 0 deletions pagebuilder/modules/button-mod-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
Expand Down
10 changes: 9 additions & 1 deletion templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -7782,4 +7782,12 @@ function ampforwp_sd_feature_image_guidlines($metadata){
}
return $metadata;
}
}
}
// 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;}
<?php }
}

0 comments on commit e55cc26

Please sign in to comment.