Sometimes embedding an item via oEmbed is not possible, for example when a YouTube video has embedding disabled. The oEmbed service will return a 401 Unauthorized
, and the code will not be converted.
Is there a way to notify the user of this? The current workflow is non-intuitive (at least to me), and I would prefer a message on the WordPress page, or even better, in the editor, saying that the object could not be embedded.
Not possible with current code.
WP_oEmbed
object goes extra mile (more like miles) to sanitize input so it is either html or booleanfalse
. All errors with fetching are discarded on output, there are no filters in there and only error (hardcoded) it handles is501 not implemented
.Earliest you can mess with this is somewhere down in HTTP API.