Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Please add shortcode_atts filter support

$
0
0

Replies: 0

This is a super easy thing to add. In rt-reading-time.php on line 114-118, add the name of the filter to the shortcode_atts call. Like this:

		extract (shortcode_atts(array(
			'label' => '',
			'postfix' => '',
			'postfix_singular' => '',
		), $atts, 'rt_reading_time'));

This will permit the atts to be filterable like this

add_filter( 'shortcode_atts_rt_reading_time', 'cnmd_adjust_reading_time_attributes', 10, 4 );

This has been a feature of shortcode_atts since 3.6, 5 years ago.

More info

https://amdrew.com/how-to-filter-shortcodes-in-wordpress-3-6/
https://markjaquith.wordpress.com/2013/04/04/wordpress-36-shortcode-attribute-filter/

  • This topic was modified 1 hour, 2 minutes ago by theMikeD.
  • This topic was modified 1 hour, 1 minute ago by theMikeD.

Viewing all articles
Browse latest Browse all 59525

Trending Articles