WP_Widget_Custom_HTML::_filter_gallery_shortcode_attrs() – Filter gallery shortcode attributes.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$array = WP_Widget_Custom_HTML::_filter_gallery_shortcode_attrs( $attrs );

Parameters

$attrs
( array ) required – Attributes.

Returns

array Attributes.

Source

File name: wordpress/wp-includes/widgets/class-wp-widget-custom-html.php
Lines:

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

 View on GitHub View on Trac