Skip to content

Editor: Fix missing frontend section presets output.#3322

Closed
jorgefilipecosta wants to merge 1 commit into
WordPress:trunkfrom
jorgefilipecosta:fix/backport-missing-rontend-section-presets-output
Closed

Editor: Fix missing frontend section presets output.#3322
jorgefilipecosta wants to merge 1 commit into
WordPress:trunkfrom
jorgefilipecosta:fix/backport-missing-rontend-section-presets-output

Conversation

@jorgefilipecosta

Copy link
Copy Markdown
Member

Backports PHP changes in WordPress/gutenberg#42124 to the core. Adds the missing mechanism to output frontend styles of block level presets to the core. Props mcsf, oandregal, dmsnell, draganescu.
See #56467.

Testing

Paste the following code on a post:

<!-- wp:group {"settings":{"blocks":{"core/social-links":{"color":{"palette":{"custom":[{"slug":"button-red","color":"red","name":"button red"},{"slug":"button-blue","color":"blue","name":"button blue"}]}}}},"color":{"palette":{"custom":[{"slug":"global-aquamarine","color":"aquamarine","name":"Global aquamarine"},{"slug":"global-pink","color":"pink","name":"Global Pink"}]}}}} -->
<div class="wp-block-group"><!-- wp:paragraph -->
<p>Leaf paragraph of inner group block.</p>
<!-- /wp:paragraph -->

<!-- wp:social-links {"iconBackgroundColor":"button-red","iconBackgroundColorValue":"red","showLabels":true} -->
<ul class="wp-block-social-links has-visible-labels has-icon-background-color"><!-- wp:social-link {"url":"w.org","service":"wordpress","label":"red"} /--></ul>
<!-- /wp:social-links -->

<!-- wp:social-links {"iconBackgroundColor":"button-blue","iconBackgroundColorValue":"blue","showLabels":true} -->
<ul class="wp-block-social-links has-visible-labels has-icon-background-color"><!-- wp:social-link {"url":"w.org","service":"wordpress","label":"blue"} /--></ul>
<!-- /wp:social-links -->

<!-- wp:paragraph {"backgroundColor":"global-aquamarine"} -->
<p class="has-global-aquamarine-background-color has-background">global-aquamarine</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"backgroundColor":"global-pink"} -->
<p class="has-global-pink-background-color has-background">global-pink</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

Verify the front-end result is:
image

Backports PHP changes in WordPress/gutenberg#42124 to the core. Adds the missing mechanism to output frontend styles of block level presets to the core.
Props mcsf, oandregal, dmsnell, draganescu.
See #56467.
@jorgefilipecosta

Copy link
Copy Markdown
Member Author

Committed in 2b1febd.

@ockham

ockham commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

Unfortunately, this seems to cause a fatal when the current stable version of the Gutenberg plugin is enabled:

Warning: Declaration of WP_Theme_JSON_6_1::get_stylesheet($types = Array, $origins = NULL) should be compatible with WP_Theme_JSON::get_stylesheet($types = Array, $origins = NULL, $options = Array) in /var/www/src/wp-content/plugins/gutenberg/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php on line 630

@jorgefilipecosta Could you revert this for now? We need to figure out a way that's compatible with the GB plugin 🙂

@ockham

ockham commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

Update: Jorge reverted this in decd946. Thank you!

He also mentioned that we'll need to coordinate landing this with a Gutenberg release that includes the updated function signature. I believe that's WordPress/gutenberg#42124.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants