UI does not show correct Slug after modified using save_post action

Through trial and error I was able to get this working reliably without further hooks or using JavaScript in the Editor.

After restoring the hook, I added

clean_post_cache($post_id);

Separately, I updated the order of priority (from 10 to 5) for the original action.

The code in the original question has been updated to reflect this.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)