SHOW:
|
|
- or go back to the newest paste.
1 | - | function pm_regenerate_custom_permalink($post_id) { |
1 | + | function pm_regenerate_custom_permalink($post_ID, $post, $update) { |
2 | global $permalink_manager_uris; | |
3 | - | |
3 | + | |
4 | - | $permalink_manager_uris[$post_id] = Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id); |
4 | + | if($update) { |
5 | - | update_option('permalink-manager-uris', $permalink_manager_uris); |
5 | + | $permalink_manager_uris[$post_id] = Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id); |
6 | - | } |
6 | + | update_option('permalink-manager-uris', $permalink_manager_uris); |
7 | } | |
8 | } | |
9 | add_action('save_post', 'pm_regenerate_custom_permalink', 10, 3); |