wp-shortcake/shortcake-bakery

"Add embed" Ajax reversal could use more context and a filter, to allow for replicating of protected embeds

Closed this issue · 1 comments

It would be nice if the "Add embed" functionality in this plugin could be extended, either here in the plugin, or elsewhere in themes or add-on plugins, to completely replace the "protected embed" functionality on WordPress VIP.

In order for this to happen, I see two things that need to be added there.

  1. The post ID needs to be posted along with the Ajax "embed_reverse" request, so that any solution which involves saving to post meta can save in the correct place.
  2. A filter needs to be added after shortcode reversals, but before the response, so that additional replacements can be performed.

One possible approach, which could work for some edge cases, is saving embed code which doesn't match any known embeds to post meta, then filtering the response to return a shortcode which references that post meta value.