Run a sql (update) after 12 hours after the user login. Woocommerce users

You could do something like this (this code has not been testedt). function schedule_sql_command($user_login, $user) { // 12 hours in seconds. $from_now = 12 * 60 * 60; // schedule a call to a custom hook passing in the user’s ID wp_schedule_single_event(time() + $from_now, ‘run_sql_command’, array( $user->ID) ); } // this is the custom hook … Read more

WP_Query() not working as expected

Ah, nevermind. Found it. I’m using another plugin (EDD Hide Download) which hides certain downloads and does that by hooking into the pre_get_posts action, which is triggered in WP_Query. The download in question was marked as hidden, that’s why WP_Query didn’t return it. To resolve this, I did the following. I added an action which … Read more