Filter posts by comparing custom meta value against postdate
I think the below solution will work- add_action( ‘pre_get_posts’, ‘the_dramatist_filter_shop_order’ ); function the_dramatist_filter_shop_order( $query ) { if( is_admin() && $query->is_main_query() && in_array( $query->get(‘post_type’), array(‘shop_order’) ) ) { add_filter( ‘posts_join’, ‘the_dramatist_shop_order_query_join’ ); add_filter( ‘posts_where’, ‘the_dramatist_shop_order_filter_date’ ); } } function the_dramatist_shop_order_filter_date( $where ){ global $wpdb; $where .= ” AND pm.meta_key = ‘_delivery_date_ymd’ AND pm.meta_value != ” AND … Read more