Displaying oEmbed errors?

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.

Related posts

Leave a Reply

1 comment

  1. Not possible with current code.

    WP_oEmbed object goes extra mile (more like miles) to sanitize input so it is either html or boolean false. All errors with fetching are discarded on output, there are no filters in there and only error (hardcoded) it handles is 501 not implemented.

    Earliest you can mess with this is somewhere down in HTTP API.