When using Tribe Events Calendar, querying for a specific event category returns nothing
Okay so it turned out to be that I was using the incorrect action name. I changed “init” to “wp_loaded” in add_action() and that did the trick.
Okay so it turned out to be that I was using the incorrect action name. I changed “init” to “wp_loaded” in add_action() and that did the trick.
You just need to set it up like this: if ( ! wp_next_scheduled( ‘check_event_status’ ) ) { wp_schedule_event( time(), ‘daily’, ‘check_event_status’ ); } add_action( ‘check_event_status’, ‘set_event_status’ ); install the Debug bar plugin and add the cron extension for it if You need some debuging info about the cron job and to be able to manually … Read more
Move your form processing code outside the shortcode so you can hook it to an earlier action before headers are sent, then you can do whatever redirection you need to after the form is processed. function process_int_form(){ if ( isset( $_REQUEST[‘int_prefix’] ) && isset( $_REQUEST[‘int_suffix’] ) ) { // process form wp_redirect( home_url( $_SERVER[‘REQUEST_URI’] ) … Read more
Please read carefully about wp_schedule_single_event in Codex. As you can see, there is a third argument $args. You can schedule a singule WP_Cron event by modifying the function you use above and passing arguments as third parameter: <?php // Your basic hook schelduling… wp_schedule_single_event( time() + 30, ‘user_cron_event’, array( ‘user_id’ => $user_id, ‘oldmoney’ => $oldmoney, … Read more
Maybe try something along the lines of using pre_get_posts to edit the ordering. function reverse_order_homepage($query){ if($query->is_home()){ $query->set(‘order’, ‘DESC’); } return $query; } add_action(‘pre_get_posts’, ‘reverse_order_homepage’);
I think that you have poor data design. The solution, in my opinion, is to alter how your data is saved. If you saved all of your dates under the same key name you could run a relatively simple query to get the next date. $args = array( ‘meta_query’ => array( ‘relation’ => ‘OR’, array( … Read more
You can simplify your save handler by checking if the POST variable is set. If it isn’t, no need to handle the request: function save_files( $post_id, $post ) { if( ! isset( $_POST[‘image_upload_nonce’] ) || ! current_user_can( ‘edit_post’, $post_id ) ) return; // Good to go, handle everything. } For an explanation on why the … Read more
Personally, I would have just one (WordPress) cron event that fired daily. All queued emails are stored in a table/option. Now all you do in your cron handler is grab the next email in the queue, process it, and then delete it. There. One email a day. You could have the option in the UI … Read more
I would use the Google Tag Manager firing options: Or Old school jQuery solution: function($){ $(‘.widget_class’).click(function() { ga(‘send’, ‘event’, ‘Sidebar Image’, ‘Promo Image’, ‘Clicked’); }); })(jQuery); Now you just add a class name to your links.
WooCommerce event works in jQuery but not in JavaScript