Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Link: Fix server-side rendering for legacy format #20074

Merged
merged 1 commit into from Feb 7, 2020

Conversation

@mcsf
Copy link
Contributor

mcsf commented Feb 6, 2020

Fixes a regression introduced in #19887.

While changing the logic in register_block_core_social_link to consume the block type's block.json and switch to the $service attribute name, I broke the handling of the legacy format for social links.

Old format: <!-- wp:social-link-wordpress {"url":"foo"} /-->
New format: <!-- wp:social-link {"service":"wordpress","url":"foo"} /-->

This fixes the handling of legacy social links by providing the adequate attribute default for each $service.

How has this been tested?

Make sure both new and old formats of social links are correctly rendered in the front-end.

Screenshots

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.
Fixes a regression introduced in #19887.

While changing the logic in `register_block_core_social_link` to consume
the block type's `block.json` and switch to the `$service` attribute
name, I broke the handling of the legacy format for social links.

Old format: <!-- wp:social-link-wordpress {"url":"foo"} /-->
New format: <!-- wp:social-link {"service":"wordpress","url":"foo"} /-->

This fixes the handling of legacy social links by providing the adequate
attribute default for each `$service`.
@gziolo
gziolo approved these changes Feb 7, 2020
@gziolo gziolo merged commit bf3042f into master Feb 7, 2020
3 checks passed
3 checks passed
pull-request-automation
Details
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo added this to Done in WordPress 5.4 Must Have via automation Feb 7, 2020
@gziolo gziolo deleted the fix/social-link-render-backcompat branch Feb 7, 2020
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
chipsnyder added a commit that referenced this pull request Feb 7, 2020
Fixes a regression introduced in #19887.

While changing the logic in `register_block_core_social_link` to consume
the block type's `block.json` and switch to the `$service` attribute
name, I broke the handling of the legacy format for social links.

Old format: <!-- wp:social-link-wordpress {"url":"foo"} /-->
New format: <!-- wp:social-link {"service":"wordpress","url":"foo"} /-->

This fixes the handling of legacy social links by providing the adequate
attribute default for each `$service`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.