Can I run a slow action in a seperate thread?

Techcrunch has released a library to spawn an asynchronous task within WordPress. https://github.com/techcrunch/wp-async-task Essentially, you can take any process that is triggered by an action hook, and you can defer the processing on that hook to run asynchronously. You extend the class to define which action you are triggering and a couple of functions to …

Read more

Run a Change Role Cron Job on WordPress via cPanel

Managed to find the solution. My finished code is: register_activation_hook ( __FILE__, ‘cron_job’ ); function cron_job() { wp_schedule_event( time(), ‘hourly’, ‘hourly_job’ ); } add_action( ‘hourly_job’, ‘cron_job_task’ ); function cron_job_task () { $users = get_users( array( ‘fields’ => array( ‘ID’, ‘user_registered’ ), ‘role’ => ‘coaching’, ) ); foreach ( $users as $user ) { $time = …

Read more