Some users might not be using Gutenberg, but are instead using a page builder like Divi or Elementor that doesn't support blocks. Should we be adding shortcodes for those cases?
Focus on Gutenberg blocks only.
Support request for this: #3086
_Do not alter or remove anything below. The following sections will be managed by moderators only._
Google\Web_Stories\Shortcodes\Embed classinit(): calls add_shortcode( 'web_stories_embed', [ $this, 'render_shortcode' )render_shortcode(): callback used for add_shortcode(). It will look largely similar to Embed_Block::render_block()init() in Plugin classtransform function that allows transforming instances of this shortcode into the embed block.This should be pretty simply if we have the different render type working. It would be a matter of taking url param and rendering like the block.
Increasing the priority of this ticket given the popularity of this request (top requested feature during the Beta period)
@swissspidy @choumx and @amedina - for your consideration - when would be a good sprint to slot this into? Any PM/UX dependency?
Is "none" an option? 🙂 Because that's what I would strongly vote on.
We have to differentiate the context of all these requests a bit. Most of the time they want integrations with their page builder.
Shortcodes themselves are a dying feature in WordPress. Blocks are the way to go. So it doesn't really make sense to bet on this horse.
Integrations with page builders are a different beast, and should be something to tackle as part of our ecosystem work.
@swissspidy I think that integrations with page builders makes a ton of sense to start, and deprioritize shortcode.
Is there a workaround we can provide to users so they can get around this (some generic embedding mechanism that doesn't require them waiting for per-page builder effort?)
@o-fernandez So, I was considering just pointing users to use <amp-story-player> markup directly as shown in the docs, but I've come to the realization that this wouldn't get them good results out of the box:
Then, I thought about just writing a simple shortcode mini-plugin for some users to install on their site. At that point I realized we could just as well incorporate it in the plugin, even if I'm not super fond of it — but it's better for the users.
I suggest for WP pod to tackle shortcode support for the next sprint.
It should be super easy to add.
Thanks for thinking through the options, this makes sense to me. @choumx FYI and for consideration.
"Super easy to add" SGTM. :)
If it takes longer than a couple days of work, then we should consider doing a quick cost-benefit analysis WRT number of impacted users.
@spacedmonkey I added an IB in ticket above with an estimate. Curious to hear your feedback on it. Anything I missed? Feel free to adjust directly.
@swissspidy This should be extremely simple. Much of the logic in Embed_Block could be reused. In fact I believe that render_block could even be used for the add_shortcode callback.
The biggest piece of work here, is moving the code around and making it a little bit more generic to make it reuable.
Maybe much of the logic for Embed_Block could be moved to a new called Embed and Embed_Block and Embed_Shortcode could extend that.
If it takes longer than a couple days of work, then we should consider doing a quick cost-benefit analysis WRT number of impacted users.
tl;dr: The implementation of the shortcode(s) is super quick, but it requires some overdue/necessary refactoring on the PHP side. That refactoring would also need to happen once we start adding more blocks.
Most helpful comment
@o-fernandez So, I was considering just pointing users to use
<amp-story-player>markup directly as shown in the docs, but I've come to the realization that this wouldn't get them good results out of the box:Then, I thought about just writing a simple shortcode mini-plugin for some users to install on their site. At that point I realized we could just as well incorporate it in the plugin, even if I'm not super fond of it — but it's better for the users.
I suggest for WP pod to tackle shortcode support for the next sprint.
It should be super easy to add.