Created
November 4, 2016 12:59
-
-
Save X-Raym/ccc78959fd38ef3b016c33a70436d7fa to your computer and use it in GitHub Desktop.
Ultimate Post Widget for Easy Digital Downloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Ultimate Post Widget for Easy Digital Downloads | |
| */ | |
| // NOTE: WOrk in progress | |
| add_filter('upw_wp_query_args', 'upw_only_posts_with_same_edd_category', 10 , 2); | |
| function upw_only_posts_with_same_edd_category($args, $instance) { | |
| if ( $instance['class'] === 'upw-edd-store' ) { | |
| //TODO FIlter with CURRENT Download Category !! or add hard coded check | |
| d($args); | |
| d($instance); | |
| $args['tax_query'] = array( | |
| array( | |
| 'taxonomy' => 'download_category', | |
| 'field' => 'name', | |
| 'terms' => 'reascripts', | |
| ), | |
| ); | |
| d($args); | |
| } | |
| return $args; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment