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

[Enhancement] Add ability to transform audio shortcodes to audio blocks #14045

Merged
merged 1 commit into from
Mar 18, 2019
Merged

[Enhancement] Add ability to transform audio shortcodes to audio blocks #14045

merged 1 commit into from
Mar 18, 2019

Conversation

nfmohit
Copy link
Member

@nfmohit nfmohit commented Feb 22, 2019

Description

This PR adds the ability to transform [audio] shortcodes to audio blocks, like the gallery and caption shortcodes have.

How has this been tested?

This PR has been tested by going through the following steps:

  1. Using the Classic Editor, added a [audio] shortcode to the content, e.g. [audio src="https://gutenberg.local/wp-content/uploads/2018/12/snow.mp3"]
  2. Using the Gutenberg editor, convert the Classic block contents to Gutenberg blocks using "Convert to Blocks".
  3. Made sure that the shortcode converts to an appropriate audio block and transform contains all the existing attributes of the shortcode.

Screenshots

gutenberg-audio-shortcode-transform-block-min

Types of changes

This PR follows the shortcode transformation structure of the gallery and caption blocks and implements them accordingly in the audio block.

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.

@gziolo gziolo added [Block] Video Affects the Video Block [Feature] Shortcodes Related to shortcode functionality [Type] Enhancement A suggestion for improvement. labels Feb 22, 2019
@gziolo gziolo added this to the 5.2 (Gutenberg) milestone Feb 22, 2019
@gziolo gziolo added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Feb 22, 2019
Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the code and it appears to work perfect.

Created a post with the classic editor and added a paragraph and an audio shortcode. Opening the post with the block editor and converting results in the audio shortcode transformed in an audio block that preserves the settings of the audio shortcode.

@youknowriad
Copy link
Contributor

This might need to be rebased for the e2e tests.

@Soean Soean added [Block] Audio Affects the Audio Block and removed [Block] Video Affects the Video Block labels Mar 3, 2019
@youknowriad youknowriad removed this from the 5.3 (Gutenberg) milestone Mar 18, 2019
@youknowriad youknowriad merged commit fec7ea1 into WordPress:master Mar 18, 2019
@youknowriad youknowriad added this to the 5.3 (Gutenberg) milestone Mar 18, 2019
@nfmohit
Copy link
Member Author

nfmohit commented Mar 18, 2019

Thank you so much for the rebase @youknowriad ❤️. Sincere apologies as I couldn't make it, it was a hectic week 😞

@youknowriad
Copy link
Contributor

No worries, it's fine :) Thanks for the PR and I hope to see a lot more :)

@nfmohit
Copy link
Member Author

nfmohit commented Mar 18, 2019

THANK YOU SO MUCH 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Audio Affects the Audio Block [Feature] Shortcodes Related to shortcode functionality Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants