Created
February 24, 2021 15:35
-
-
Save Pebblo/4495f0e3957b2123c216e9d55121b658 to your computer and use it in GitHub Desktop.
Example of how to remove the post_where filter used in the Royal Event theme which prevents the use of custom post statuses.
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 //Please do not include the opening PHP tag if you already have one. | |
add_filter( 'posts_where', 'tw_ee_remove_royal_event_query_posts_where', 9, 2 ); | |
function tw_ee_remove_royal_event_query_posts_where($where, $query) { | |
if( $query->query_vars['post_type'] == 'espresso_events' ) { | |
remove_filter( 'posts_where', 'royal_event_query_posts_where' ); | |
} | |
return $where; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment