WP_Widget_Text::_filter_gallery_shortcode_attrs

Advertisement

Summery Summery

Filter gallery shortcode attributes.

Syntax Syntax

WP_Widget_Text::_filter_gallery_shortcode_attrs( array $attrs )

Description 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 Parameters

$attrs

(array) (Required) Attributes.

Return Return

(array) Attributes.

Source 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;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.