wppaste
WordPress

apply_filters( 'pre_wp_get_loading_optimization_attributes', array|false $loading_attrs, string $tag_name, array $attr, string $context )

Since
6.4.0
Filters whether to short-circuit loading optimization attributes.

Description

Returning an array from the filter will effectively short-circuit the loading of optimization attributes, returning that value instead.

Compatibility

WordPress
since 6.4.0
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Parameters

$loading_attrsarray|false
False by default, or array of loading optimization attributes to short-circuit.
$tag_namestring
The tag name.
$attrarray
Array of the attributes for the tag.
$contextstring
Context for the element for which the loading optimization attribute is requested.

Where this hook fires · 1

  • wp-includes/media.php:5942wp_get_loading_optimization_attributes()

Source code

	 *	 * @param array|false $loading_attrs False by default, or array of loading optimization attributes to short-circuit.	 * @param string      $tag_name      The tag name.	 * @param array       $attr          Array of the attributes for the tag.	 * @param string      $context       Context for the element for which the loading optimization attribute is requested.	 */	$loading_attrs = apply_filters( 'pre_wp_get_loading_optimization_attributes', false, $tag_name, $attr, $context ); 	if ( is_array( $loading_attrs ) ) {		return $loading_attrs;	} 	$loading_attrs = array();

Changelog

Introduced in 6.4.0. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.10 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.