Advertisement
vapvarun

Flush permalinks

Apr 12th, 2021
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. // Flush permalinks
  2. add_action('vap_hourly_event', 'vap_do_this_hourly');
  3. function vap_activation() {
  4.     if ( !wp_next_scheduled( 'vap_hourly_event' ) ) {
  5.         wp_schedule_event(time(), 'hourly', 'vap_hourly_event');
  6.     }
  7. }
  8.  
  9. add_action('wp', 'vap_activation');
  10. function vap_do_this_hourly() {
  11.     global $wp_rewrite;
  12.     $wp_rewrite->flush_rules();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement