mbis

Regenerate permalink after post is saved

Jan 21st, 2021
907
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pm_regenerate_custom_permalink($post_ID, $post, $update) {
  2.     global $permalink_manager_uris;
  3.  
  4.     if($update) {
  5.         $permalink_manager_uris[$post_id] = Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id);
  6.         update_option('permalink-manager-uris', $permalink_manager_uris);
  7.     }
  8. }
  9. add_action('save_post', 'pm_regenerate_custom_permalink', 10, 3);
RAW Paste Data