Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Create a dynamic block to replace the [bw_css] shortcode #13
The [bw_css] shortcode, from the oik-css plugin, is used to create inline CSS.
Gutenberg doesn't yet support this shortcode - see Gutenberg issues 5123 and 4456, already referenced by #22 - so we need to support it ourselves.
Note: As previously noted I envisage there to be a problem with this - see #22 - and Gutenberg issues 5760 and 5968.
I've developed a quick and dirty hack for WordPress/gutenberg#5760 which enables a dynamic block to determine the content that it expects.
Now I have to add the
After a short discussion with @aduth I have changed the code so that what was intended to be the dynamic content is saved as an attribute of the block. The dynamic block rendering function simply extracts this attribute and passes it to the implementing shortcode function as the $content parameter.
So I no longer need the quick and dirty hack that I implemented in
In this early working version the attribute is still called
Here's an updated screen capture, showing that the new lines have been respected. Hurrah!
Note: I wouldn't normally use CSS to force
Apr 7, 2018
Oct 22, 2018
referenced this issue
Nov 23, 2018
I included the CSS block in the wp-pompey website. It caused an Updating failed message in the editor, but the block was saved. In the front end the page crashed.
oik-css was not installed!