easydigitaldownloads/Easy-Digital-Downloads — pull request #1409 by sumobi (2013-07-25 01:38:58+00:00)
Title: Pass $atts with edd_downloads_query

One more thing, just need to pass $atts along with the filter

Then I can do this in EDD featured downloads plugin:

Add new "featured" parameter to [downloads] shortcode:
Example usage: [downloads featured="yes"]

function edd_fd_filter_downloads_shortcode( $out, $pairs, $atts ) {
$out['featured'] = '';
return $out;
}
add_filter( 'shortcode_atts_downloads', 'edd_fd_filter_downloads_shortcode', 10, 3 );

Filter the $query to only show the featured downloads

function edd_fd_filter_downloads_query( $query, $atts ) {
if( 'yes' == $atts['featured'] )
$query['meta_key'] = 'edd_feature_download';

return $query;
}
add_filter( 'edd_downloads_query', 'edd_fd_filter_downloads_query', 10, 2 );

How awesome is that :)