Hot answers tagged

2

First, you should always use the WordPress AJAX methods, not a custom function for that. See AJAX in Plugins in the Codex. With that practice in mind, you can set up your request like this. Change the AJAX URL to <?php echo admin_url('admin-ajax.php'); ?> and add the actionyou want WordPress to execute in the next step to your data . ...


1

You can get both with an OR meta_query that also checks if the key does not exist: 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'event_date', 'compare' => 'NOT EXISTS', ), array( 'key' => 'event_date', 'value' => date("Ymd", time()), 'compare' => '>', ), ), ...



Only top voted, non community-wiki answers of a minimum length are eligible