gallery_style │ хук-фильтр │ WP 2.5.0

Filters the gallery shortcode's default CSS styles and opening HTML div container.

To remove the CSS entirely, use the use_default_gallery_style instead:

add_filter( 'use_default_gallery_style', '__return_false' );

Использование

add_filter( 'gallery_style', 'wp_kama_gallery_style_filter' );

/**
 * Function for `gallery_style` filter-hook.
 * 
 * @param string $gallery_style Default CSS styles and opening HTML div container for the gallery
 *                              shortcode output.
 *
 * @return string
 */
function wp_kama_gallery_style_filter( $gallery_style ){
	// filter...
	return $gallery_style;
}
$gallery_style(строка)
Default CSS styles and opening HTML div container for the gallery shortcode output.

Список изменений

С версии 2.5.0 Введена.
С версии 3.1.0 Added classes for number of columns and size to opening div.
С версии 5.3.0 Removed the type attribute for style tags when the theme supports HTML5 style, and changed the quotes from single to double for other themes.
С версии 7.0.0 Removed the type attribute for any theme.

Где вызывается хук

gallery_shortcode()
gallery_style
wp-includes/media.php 3033
$output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );

Где используется хук в WordPress

Использование не найдено.