Skip to content

Commit

Permalink
Plugin: Filter safe CSS to allow column flex-basis CSS attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed May 9, 2019
1 parent 6880cfa commit 5bb641c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/compat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Temporary compatibility shims for features present in Gutenberg, pending
* upstream commit to the WordPress core source repository. Functions here
* exist only as long as necessary for corresponding WordPress support, and
* each should be associated with a Trac ticket.
*
* @package gutenberg
*/

/**
* Filters allowed CSS attributes to include `flex-basis`, included in saved
* markup of the Column block.
*
* @since 5.7.0
*
* @param string[] $attr Array of allowed CSS attributes.
*
* @return string[] Filtered array of allowed CSS attributes.
*/
function gutenberg_safe_style_css_column_flex_basis( $attr ) {
$attr[] = 'flex-basis';

return $attr;
}
add_filter( 'safe_style_css', 'gutenberg_safe_style_css_column_flex_basis' );
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
require dirname( __FILE__ ) . '/rest-api.php';
}

require dirname( __FILE__ ) . '/compat.php';
require dirname( __FILE__ ) . '/blocks.php';
require dirname( __FILE__ ) . '/client-assets.php';
require dirname( __FILE__ ) . '/demo.php';
Expand Down

0 comments on commit 5bb641c

Please sign in to comment.