Opened 9 years ago
Closed 9 years ago
#33917 closed enhancement (duplicate)
Using wp_editor outside the post editor screen does not give oembed functionality
Reported by: | mbootsman | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | Embeds | Keywords: | |
Focuses: | Cc: |
Description
I want to use wp_editor in a admin screen to fill a dashboard widget.
So I coded the following, expecting oembed to work out of the box:
https://gist.github.com/mbootsman/892fd5841e59a6e6a077
It appears the parse-embed AJAX call returns 'success: false' because there is a check for post_ID, and that post_ID is not there since I'm using the option API (get_option, update_option).
I suspect this is unwanted behaviour, as the wp_editor can be used for more than only post content.
Change History (4)
#2
@
9 years ago
- Type changed from defect (bug) to enhancement
Thanks for your answer Alex.
Is there a possibility that using the wp_editor() outside of post editing will be able to support oembed requests in core?
I think it would me nice to have the same functionality for the editor, where ever it is used, in a post or as an option input.
#3
@
9 years ago
This isn't so much of an editor limitation but rather a limitation of the embeds functionality and how it was designed. It wasn't written to work outside of the context of a post and so trying to use it for a widget or anywhere else is going to require some custom implementation on your part, mainly where to cache requests so that you aren't making an HTTP request on every page load.
This is likely wontfix
, at least for now. :(
#4
@
9 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
This isn't so much of an editor limitation but rather a limitation of the embeds functionality and how it was designed. It wasn't written to work outside of the context of a post and so trying to use it for a widget or anywhere else is going to require some custom implementation on your part, mainly where to cache requests so that you aren't making an HTTP request on every page load.
Correct. We need a fallback for the case where you're not inside a post, which we can handle in #34115.
This is likely expected behavior. The results of oEmbed requests are cached to post meta and so without a post object to work off of, the standard oEmbed implementation can't work.
Even if it did work in the editor, it's not going to render in your dashboard widget for the same reason.