use_default_gallery_style
Filter HookDescription
Filters whether to print default gallery styles.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2847 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$print
|
Whether to print default gallery styles. Defaults to false if the theme supports HTML5 galleries. Otherwise, defaults to true. |
Usage Examples
Basic Usage
<?php
// Hook into use_default_gallery_style
add_filter('use_default_gallery_style', 'my_custom_filter', 10, 1);
function my_custom_filter($print) {
// Your custom filtering logic here
return $print;
}
Source Code Context
wp-includes/media.php:2847
- How this hook is used in WordPress core
<?php
2842 *
2843 * @param bool $print Whether to print default gallery styles.
2844 * Defaults to false if the theme supports HTML5 galleries.
2845 * Otherwise, defaults to true.
2846 */
2847 if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
2848 $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
2849
2850 $gallery_style = "
2851 <style{$type_attr}>
2852 #{$selector} {
PHP Documentation
<?php
/**
* Filters whether to print default gallery styles.
*
* @since 3.1.0
*
* @param bool $print Whether to print default gallery styles.
* Defaults to false if the theme supports HTML5 galleries.
* Otherwise, defaults to true.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.