Filter hook 'shortcode_atts_{$shortcode}'

in WP Core File wp-includes/shortcodes.php at line 690

View Source

shortcode_atts_{$shortcode}

Filter Hook
Description
Filters shortcode attributes. If the third parameter of the shortcode_atts() function is present then this filter is available. The third parameter, $shortcode, is the name of the shortcode.

Hook Information

File Location wp-includes/shortcodes.php View on GitHub
Hook Type Filter
Line Number 690

Hook Parameters

Type Name Description
array $out The output array of shortcode attributes.
array $pairs The supported attributes and their defaults.
array $atts The user defined shortcode attributes.
string $shortcode The shortcode name.

Usage Examples

Basic Usage
<?php
// Hook into shortcode_atts_{$shortcode}
add_filter('shortcode_atts_{$shortcode}', 'my_custom_filter', 10, 4);

function my_custom_filter($out, $pairs, $atts, $shortcode) {
    // Your custom filtering logic here
    return $out;
}

Source Code Context

wp-includes/shortcodes.php:690 - How this hook is used in WordPress core
<?php
 685  		 * @param array  $out       The output array of shortcode attributes.
 686  		 * @param array  $pairs     The supported attributes and their defaults.
 687  		 * @param array  $atts      The user defined shortcode attributes.
 688  		 * @param string $shortcode The shortcode name.
 689  		 */
 690  		$out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode );
 691  	}
 692  
 693  	return $out;
 694  }
 695  

PHP Documentation

<?php
/**
		 * Filters shortcode attributes.
		 *
		 * If the third parameter of the shortcode_atts() function is present then this filter is available.
		 * The third parameter, $shortcode, is the name of the shortcode.
		 *
		 * @since 3.6.0
		 * @since 4.4.0 Added the `$shortcode` parameter.
		 *
		 * @param array  $out       The output array of shortcode attributes.
		 * @param array  $pairs     The supported attributes and their defaults.
		 * @param array  $atts      The user defined shortcode attributes.
		 * @param string $shortcode The shortcode name.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/shortcodes.php
Related Hooks

Related hooks will be displayed here in future updates.