gallery_style
Filter HookDescription
Filters the default gallery shortcode CSS styles.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2882 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$gallery_style
|
Default CSS styles and opening HTML div container for the gallery shortcode output. |
Usage Examples
Basic Usage
<?php
// Hook into gallery_style
add_filter('gallery_style', 'my_custom_filter', 10, 1);
function my_custom_filter($gallery_style) {
// Your custom filtering logic here
return $gallery_style;
}
Source Code Context
wp-includes/media.php:2882
- How this hook is used in WordPress core
<?php
2877 * @since 2.5.0
2878 *
2879 * @param string $gallery_style Default CSS styles and opening HTML div container
2880 * for the gallery shortcode output.
2881 */
2882 $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
2883
2884 $i = 0;
2885
2886 foreach ( $attachments as $id => $attachment ) {
2887
PHP Documentation
<?php
/**
* Filters the default gallery shortcode CSS styles.
*
* @since 2.5.0
*
* @param string $gallery_style Default CSS styles and opening HTML div container
* for the gallery shortcode output.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.