WordPress at a glance
function is not described

WP_Widget_Text::_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.

{} It's a method of the class: WP_Widget_Text{}

No Hooks.

Return

Array. Attributes.

Usage

$WP_Widget_Text = new WP_Widget_Text();
$WP_Widget_Text->_filter_gallery_shortcode_attrs( $attrs );
$attrs(array) (required)
Attributes.

Changelog

Since 4.9.0 Introduced.

Code of WP_Widget_Text::_filter_gallery_shortcode_attrs() WP 5.7.2

<?php
public function _filter_gallery_shortcode_attrs( $attrs ) {
	if ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {
		$attrs['id'] = -1;
	}
	return $attrs;
}