I am trying to add oEmbed DeviantArt integration to a custom theme.
I found that first step is quite easy, I added
wp_oembed_add_provider( 'http://*.deviantart.com/#/d*', 'http://backend.deviantart.com/oembed' );
to theme’s functions.php.
Now, I would like to change the default HTML output to add more information, available in DeviantArt JSON response (DeviantART reference), like author_name, author_url, etc.
If I have studied well the WP code that manage the output is inside function data2html in class-oembed.php, but I don’t like change the code here.
How can I add a function to my theme, to achieve the desired result?
WP_oEmbed::data2html()
has a filter,oembed_dataparse
. You can use this to change the output, based on the extra data which is passed as the second parameter.Something like this for example: