Skip to content

Instantly share code, notes, and snippets.

@verygoodplugins
Created July 9, 2018 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verygoodplugins/790abb88ab5a8dc07429749707bb48a2 to your computer and use it in GitHub Desktop.
Save verygoodplugins/790abb88ab5a8dc07429749707bb48a2 to your computer and use it in GitHub Desktop.
Resync all user tags every Friday
<?php
if ( ! wp_next_scheduled( 'wpf_update_tags_weekly' ) ) {
wp_schedule_event(time(), 'daily', 'wpf_update_tags_weekly' );
}
add_action('wpf_update_tags_weekly', 'do_wpf_update_tags');
function do_wpf_update_tags() {
if ( date ('l') !== 'Friday' ) {
return;
}
wp_fusion()->batch->batch_init( 'users_sync' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment