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

Add cron schedule to upload video on save_post

I think the best approach would be to only save a post meta value ( [or use a custom table][1] ) which indicates that a video upload should happen. Also register a schedule that will query for all posts that are marked as “upload needed” and do the upload in the schedule execution. https://gist.github.com/EdwardBock/85c971633ea1abf8f248f4fb468344ed You … Read more