WP_Widget_Custom_HTML::_filter_gallery_shortcode_attrs() public WP 4.9.0
Filters gallery shortcode attributes.
Prevents all of a site's attachments from being shown in a gallery displayed on a non-singular template where a $post context is not available.
{} Это метод класса: WP_Widget_Custom_HTML{}
Хуков нет.
Возвращает
Массив. Attributes.
Использование
$WP_Widget_Custom_HTML = new WP_Widget_Custom_HTML(); $WP_Widget_Custom_HTML->_filter_gallery_shortcode_attrs( $attrs );
- $attrs(массив) (обязательный)
- Attributes.
Список изменений
С версии 4.9.0 | Введена. |
Код WP_Widget_Custom_HTML::_filter_gallery_shortcode_attrs() WP Widget Custom HTML:: filter gallery shortcode attrs WP 5.6
public function _filter_gallery_shortcode_attrs( $attrs ) {
if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
$attrs['id'] = -1;
}
return $attrs;
}