WP_Widget_Text::_filter_gallery_shortcode_attrs( array $attrs )
Filters gallery shortcode attributes.
Description
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.
Parameters
- $attrs
-
(array) (Required) Attributes.
Return
(array) Attributes.
Source
File: wp-includes/widgets/class-wp-widget-text.php
public function _filter_gallery_shortcode_attrs( $attrs ) { if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) { $attrs['id'] = -1; } return $attrs; }
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_widget_text/_filter_gallery_shortcode_attrs