Plugin Author
pepe
(@pputzer)
I can see adding schema.org markup (as an option), however, the case for <figure> is more difficult. In theory, we could check whether the theme supports HTML5 captions. However, to properly handle both embedded media credits (with captions) and stand-alone ones (without captions), we’d have to override the caption shortcode ourselves.
While in principle this is easy to do (and is indeed what I’ve done for my own blog), it wreaks havoc with other plugins (and themes) modifying caption. If you privately want to do it, you can just add filters to media_credit_shortcode and img_caption_shortcode.
Plugin Author
pepe
(@pputzer)
PS: I might have an idea to do that automagically, but I’ll have to test things first, so I can’t promise anything yet.
Thread Starter
sojic
(@sojic)
Thanks for the response! Take your time!
Thread Starter
sojic
(@sojic)
Here is the “minimum” html markup:
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<img src="small-image.jpg" itemprop="image" alt="Image description" />
<figcaption itemprop="caption description">
Long image description
<span itemprop="copyrightHolder">Photo: AP</span>
</figcaption>
</figure>
I will appreciate if I can get this markup! (Of course there can be link as well)
Plugin Author
pepe
(@pputzer)
I’m somewhat dubious about the duplication of semantic markup and schema.org annotations (regarding the <img> and <figcaption> tags), but I still think it’s a good idea. What I’d be reluctant to do is the itemprop="associatedMedia" on the <figure>. That needs needs enclosing schema.org annotations to make sense, if at all. What else but media files associated with the enclosing content should a <figure> be?
Anyway, even if I’m able to do the semantic markup (HTML5 and/or schema.org), “Long image description” in your example would be empty. I’m not touching standard caption elements from within Media Credit, only stand-alone shortcodes.
Plugin Author
pepe
(@pputzer)
I’ve added an enhancement request on Github to track this issue: https://github.com/mundschenk-at/media-credit/issues/2
Plugin Author
pepe
(@pputzer)
The feature will be included in 3.1.0.