最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

filters - Fire a code when permalinks updated

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

From 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

发布评论

评论列表(0)

  1. 暂无评论