Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add a from transform to each block to support legacy shortcodes #8

Closed
claudiulodro opened this issue Feb 13, 2018 · 4 comments
Closed
Labels
status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. type: enhancement The issue is a request for an enhancement.

Comments

@claudiulodro
Copy link
Contributor

If a page has the products shortcode already on it (from posts created using the classic editor) convert the shortcode into a pre-populated Products block. More investigating will need to be done to see if this is possible, but I believe Gutenberg 2.1 has some shortcode handling features so it should be possible.

Possible use case for transformations API: WordPress/gutenberg#4578

@claudiulodro claudiulodro added the type: enhancement The issue is a request for an enhancement. label Mar 15, 2018
@jameskoster jameskoster added this to the 1.0 milestone Mar 28, 2018
@claudiulodro claudiulodro modified the milestones: 1.0, 1.1, 1.2 Jun 1, 2018
@ryelle ryelle removed this from the 1.2 milestone Nov 12, 2018
@LevinMedia
Copy link
Contributor

Relates to #86

@ryelle
Copy link
Member

ryelle commented Jan 28, 2019

Looks like we can use transforms to convert supported shortcode options into our blocks: https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-registration/#transforms-optional

Shortcodes are very customizable though, so we'll still have to fall back to the core shortcode block for options the blocks don't support

@ryelle ryelle added this to the 2.0 + Core Merge milestone Jan 28, 2019
@ryelle ryelle changed the title Backwards compatibility Add a from transform to each block to support legacy shortcodes Jan 28, 2019
@ryelle ryelle self-assigned this Feb 8, 2019
@ryelle
Copy link
Member

ryelle commented Feb 13, 2019

Currently we can only map a given shortcode to one block, there's no way to check the attributes of a shortcode before running the transform. This issue is on hold until there's core support for isMatch on shortcode transforms (or whatever the solution is): WordPress/gutenberg#10674

@ryelle ryelle added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Feb 13, 2019
@ryelle ryelle removed their assignment Feb 21, 2019
@ryelle ryelle removed this from the Future release milestone Mar 18, 2019
@nerrad
Copy link
Contributor

nerrad commented Jun 7, 2020

This issue has been open for a while. While the idea is sound, there doesn’t seem to be need for the transforms at the moment. We can revisit and reopen specific issues for blocks that we want to add transforms to as the need/desire surfaces.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

5 participants