I want to add a option to the “Gallery settings” (when you insert a gallery into a post).
I once found some code on how to do this, but unfortunately I can’t find it anymore.
I can’t even remenber if it was a hook, but I think it was some hackish stuff 😉
Thx
Thanks to the hint with the multiple galleries plugin from Niall Campbell and thanks to this question How to Add a Custom Colum on Thickbox Media Gallery Tab? (where I got the hook
admin_head-media-upload-popup
from), I was able to complete the task.I’ve added an option to add a
style
attribute to the gallery shortcode.Here is the complete code:
It adds
style="slideshow"
if the slideshow style is selected, otherwise it doesn’t add anything. And it recognizes the set style if you update the gallery, so that the right option is selected.Thank you!
hmmm check out the code to Mutliple Galleries plugin, it uses a javascript workaround due to the absence of a wordpress hook for the media_upload_gallery_form function (in wp-admin/includes). It then outputs a modified gallery shortcode to the editor (with some extra attributes).
If you’re adding in additional attributes that aren’t covered by the gallery shortcode, you’ll need to write your own function for it, but there’s alot of information available to do that out there so I won’t go into that.