WordPress filter hook

edd_downloads_excerpt

Fired by 4 WordPress plugins, running on 40K+ sites between them.

“Filters the excerpt output for an individual download in [downloads] shortcode.”

How to use edd_downloads_excerpt

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'edd_downloads_excerpt', function( $trim_words ) {
	// Change $trim_words here.
	return $trim_words;
}, 10, 1 );

Argument names come from Amazing WPBakery Page Builder Addons's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

4 plugins that fire edd_downloads_excerpt

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Easy Digital Downloads icon Easy Digital Downloads40,000+ installs apply_filters( 'edd_downloads_excerpt', $excerpt ) includes/template-functions.php:1083
  2. Amazing WPBakery Page Builder Addons icon Amazing WPBakery Page Builder Addons100+ installs apply_filters( 'edd_downloads_excerpt', wp_trim_words( get_post_field( 'post_excerpt', get_the_ID() ), $excerpt_length ) ) shortcodes/edd/edd-old.php:634
  3. Product Table icon Product Table10+ installs apply_filters( 'edd_downloads_excerpt', wp_trim_words( get_post_field( 'post_excerpt', get_the_ID() ), $excerpt_length ) ) inc/eddpt-functions.php:35
  4. Element Path for Elementor icon Element Path for ElementorFewer than 10 installs apply_filters( 'edd_downloads_excerpt', wp_trim_words( get_post_field( 'post_excerpt', get_the_ID() ), $excerpt_length ) ) widgets/edd-products-grid/views/template-1.php:118

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.