I would like to execute some php code when permalinks updated, I think some plugins I'm using them updates permalinks programmatically sometime and this breaks my some slug rewrite settings, at this point I need to run code when permalinks updated. Is there any filter or event listener to make me able to this.
I would like to execute some php code when permalinks updated, I think some plugins I'm using them updates permalinks programmatically sometime and this breaks my some slug rewrite settings, at this point I need to run code when permalinks updated. Is there any filter or event listener to make me able to this.
Share Improve this question edited Oct 31, 2020 at 7:36 User9123 asked Oct 31, 2020 at 7:30 User9123User9123 32 bronze badges1 Answer
Reset to default 0From what I know you can use the post_updated or the save_post hooks
https://developer.wordpress/reference/hooks/post_updated/ https://developer.wordpress/reference/hooks/save_post/
Hope that this help. If you need any other info please let me know.
Update: Sorry for my misunderstanding. You can use the the_permalink filter. Below you have the docs
https://codex.wordpress/Plugin_API/Filter_Reference/the_permalink