I am looking to create a new field group in the gallery Attachment Details section. The field group would be called Project Tiles would contain the following fields:
- Caption Link (ideally this would be a list of all pages but could equally be a text field)
- Main Caption
- Sub Caption
I would then like this to change the HTML markup of each image caption to be as follows:
<a href="**Caption Link**"> <span class="one">**Main Caption**</span> <span class="two">**Sub Caption**</span> </a>
However I would only like the new markup to apply when the fields have been set.
I'm fairly new to Wordpress and PHP so not really sure how to go about this. Is it possible to just add something to the functions.php file instead of creating a new plugin?