use_default_gallery_style

Filters whether to print default gallery styles.

Description

apply_filters( 'use_default_gallery_style', (bool) $html5 ); 

Parameters (1)

0. $html5 (bool) => ! $html5
Whether to print default gallery styles. Defaults to false if the theme supports HTML5 galleries. Otherwise, defaults to true.

Usage

To run the hook, copy the example below.
  1. $html5 = apply_filters( 'use_default_gallery_style', $html5 ); 
  2.  
  3. if ( !empty( $html5 ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the use_default_gallery_style callback 
  2. function filter_use_default_gallery_style( $html5 ) { 
  3. // make filter magic happen here... 
  4. return $html5
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'use_default_gallery_style', 'filter_use_default_gallery_style', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'use_default_gallery_style', 'filter_use_default_gallery_style', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/media.php  
  1. if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {