View difference between Paste ID: Jmnucupk and 1UYQE2wG
SHOW: | | - or go back to the newest paste.
1
function pm_regenerate_custom_permalink($post_ID, $post, $update) {
2
	global $permalink_manager_uris;
3
4-
	if($update) {
4+
	if($post->post_type == 'courses') {
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);
9+
add_action('save_post', 'pm_regenerate_custom_permalink', 111, 3);