Add option to “Gallery Settings” section

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. … Read more

Remove [gallery] shortcode altogether

The short code is actually entered into then page or post content so disabling the short code processing prevents the gallery short code from being replaced with the gallery images but it doesn’t affect the post content. The best solution is to add a new short code handler after removing the default gallery handles. Another … Read more

Set default link type to “file” for image galleries

You can override the gallery shortcode link attribute with: add_filter( ‘shortcode_atts_gallery’, function( $out ){ $out[‘link’] = ‘file’; return $out; } ); This means that even if your shortcodes are: the gallery output will always be generated as if you used link=”file”.

Using nextGen Gallery.. how can I call a list of all Gallery Names?

All your Galleries are stored a table called wp_ngg_gallery in your wordpress database. (For the sake of completeness: nextGen Gallery creates 2 more tables for albums and pictures, respectively) $gallery_ids = $wpdb->get_results( “SELECT gid FROM “.$wpdb->prefix.”ngg_gallery ORDER BY gid ASC”, ARRAY_A); fetches the IDs of all galleries into an array, ordered by ID from 1 … Read more

Change the output for [gallery] shortcode

The source for the gallery shortcode is in wp-includes/media.php. There are a couple of hooks in there that might work for you. Without knowing exactly what you want to do, it is impossible to be more specific. If that doesn’t work then you can remove the shortcode: remove_shortcode(‘gallery’); And add another gallery shortcode with the … Read more