WordPress filter hook · part of WordPress core
use_default_gallery_style
A WordPress core filter that 26 plugins also fire themselves, running on 120K+ sites between them.
“Filters whether to print default gallery styles.”
How to use use_default_gallery_style
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'use_default_gallery_style', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from Media Library Assistant's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
26 plugins that fire use_default_gallery_style
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Media Library Assistant70,000+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )includes/class-mla-shortcode-support.php:1475 -
GeoDirectory10,000+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )includes/class-geodir-elementor.php:878 -
Related Posts by Taxonomy10,000+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )includes/gallery.php:194 -
WP Multilang10,000+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )includes/wpm-template-functions.php:314 -
SportsPress10,000+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )templates/player-gallery.php:93 -
WP Media Category Management6,000+ installs
apply_filters( 'use_default_gallery_style', !$html5 )include/shortcode/class-WP_MCM_Shortcode.php:384 -
Image Carousel1,000+ installs
apply_filters( 'use_default_gallery_style', true )inc/functions/icp-functions.php:271 -
Simple WP Retina1,000+ installs
apply_filters( 'use_default_gallery_style', true )simple-wp-retina.php:269 -
RPS Image Gallery700+ installs
apply_filters( 'use_default_gallery_style', ( $this->getFormat() === 'legacy' ) ? true : false )dependencies/rpsslideshow/display/GalleryView.php:367 -
Tribulant Gallery Voting300+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )index.php:505 -
Media Categories300+ installs
apply_filters( 'use_default_gallery_style', true )media-categories.php:337 -
Gallery Image Captions (GIC)100+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )gallery-image-captions.php:259 -
Paginated Gallery100+ installs
apply_filters( 'use_default_gallery_style', true )paginated-gallery.php:144 -
Simple Galleria for WordPress90+ installs
apply_filters( 'use_default_gallery_style', true )inc/class.shortcode.php:105 -
Post gallery slider60+ installs
apply_filters( 'use_default_gallery_style', true )templates/gallery.php:3 -
WP Gallery Download Links50+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )wp-gallery-download-links.php:142 -
PhotoPress50+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )photopress-gallery.php:152 -
WP iSell Photo40+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )wp-iSell-photo.php:287 -
Xpand Image Gallery30+ installs
apply_filters( 'use_default_gallery_style', true )XpandGalleryLite.php:207 -
Rajce embed30+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )rajce-embed.php:266 -
PrettyGallery20+ installs
apply_filters( 'use_default_gallery_style', true )prettygallery.php:133 -
Sell Photo10+ installs
apply_filters( 'use_default_gallery_style', ! $html5 )main.php:375 -
Gallery Just Better10+ installs
apply_filters( 'use_default_gallery_style', true )galleryjustbetter.php:112 -
Mega-giga-gallery-slider10+ installs
apply_filters( 'use_default_gallery_style', !$html5 )mega-giga-gallery-slider.php:408 -
Picasso10+ installs
apply_filters( 'use_default_gallery_style', true )picasso.php:106 -
Create Custom Hover Effects On Images WP PluginsFewer than 10 installs
apply_filters( 'use_default_gallery_style', ! $html5 )CreateCustomHoverEffectsOnImages.php:191
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.