Uses
Uses | Description |
---|---|
wp-includes/query.php: is_singular() | Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types). |
Filter 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.
(array) (Required) Attributes.
(array) Attributes.
File: wp-includes/widgets/class-wp-widget-custom-html.php
public function _filter_gallery_shortcode_attrs( $attrs ) { if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) { $attrs['id'] = -1; } return $attrs; }
Version | Description |
---|---|
4.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_widget_custom_html/_filter_gallery_shortcode_attrs