Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $excluded_playlists_game_id = 4;
- $query_args = array(
- 'posts_per_page' => -1,
- 'post_type' => 'xxx',
- 'meta_query' => array(
- 'key' => 'psi_playlist_games_$_psi_playlist_item',
- 'value' => $excluded_playlists_game_id,
- 'compare' => '!=',
- ),
- );
- function playlist_filter( $where ) {
- global $wpdb;
- $where = str_replace(
- "meta_key = 'sd_tour_schedule_$",
- "meta_key LIKE 'sd_tour_schedule_%",
- $wpdb->remove_placeholder_escape($where)
- );
- return $where;
- }
- add_filter( 'posts_where', 'playlist_filter' );
- $posts = get_posts( $query_args );
- remove_filter( 'posts_where', 'playlist_filter' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement