Skip to content

Commit

Permalink
Add missing attribute sources; let amp-fit-text attributes pass Kses
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed May 24, 2018
1 parent 5a45e80 commit c3d9915
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions assets/js/amp-editor-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,24 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
};
settings.attributes.minFont = {
type: 'number',
default: component.data.fontSizes.small
default: component.data.fontSizes.small,
source: 'attribute',
selector: 'amp-fit-text',
attribute: 'min-font-size'
};
settings.attributes.maxFont = {
type: 'number',
default: component.data.fontSizes.larger
default: component.data.fontSizes.larger,
source: 'attribute',
selector: 'amp-fit-text',
attribute: 'max-font-size'
};
settings.attributes.height = {
type: 'number',
default: 50
default: 50,
source: 'attribute',
selector: 'amp-fit-text',
attribute: 'height'
};
}

Expand Down
2 changes: 2 additions & 0 deletions includes/admin/class-amp-editor-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function whitelist_block_atts_in_wp_kses_allowed_html( $tags, $context )
'amp-jwplayer',
'amp-brid-player',
'amp-ima-video',
'amp-fit-text',
);

foreach ( $amp_blocks as $amp_block ) {
Expand All @@ -62,6 +63,7 @@ public function whitelist_block_atts_in_wp_kses_allowed_html( $tags, $context )
'layout',
'width',
'height',
'class',
),
true
),
Expand Down

0 comments on commit c3d9915

Please sign in to comment.