Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active January 4, 2016 07:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save amdrew/8588320 to your computer and use it in GitHub Desktop.
Show the tickets even if the download is hidden
<?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