Last active
January 4, 2016 07:19
-
-
Save amdrew/8588320 to your computer and use it in GitHub Desktop.
Show the tickets even if the download is hidden
This file contains 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 | |
$edd_hide_download = edd_hide_download(); | |
remove_action( 'pre_get_posts', array( $edd_hide_download, 'pre_get_posts' ), 9999 ); | |
function sumobi_edd_hd_custom_pre_get_posts( $query ) { | |
$edd_hide_download = edd_hide_download(); | |
global $wp_query; | |
// bail if in the admin | |
if ( is_admin() ) | |
return; | |
// bail if the download belong to the tribe_events post type | |
if ( 'tribe_events' == $wp_query->query_vars['post_type'] ) | |
return; | |
if( ! $query->is_single ) | |
$query->set( 'post__not_in', $edd_hide_download->get_hidden_downloads() ); | |
} | |
add_action( 'pre_get_posts', 'sumobi_edd_hd_custom_pre_get_posts', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment