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

plugin development - Which action is triggered when a theme was modified?

programmeradmin0浏览0评论

I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_switch_theme which is triggered only after changing from one theme to another, and load_themes.php which is triggered when entering the "Appearance" page with the list of currently installed plugins.

Which action will be triggered after configuring a theme in customizer? Which action will be triggered when a file of a child theme is modified? Which action will be triggered when a theme was updated to a newer version?

I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_switch_theme which is triggered only after changing from one theme to another, and load_themes.php which is triggered when entering the "Appearance" page with the list of currently installed plugins.

Which action will be triggered after configuring a theme in customizer? Which action will be triggered when a file of a child theme is modified? Which action will be triggered when a theme was updated to a newer version?

Share Improve this question asked Feb 20, 2020 at 15:15 Ingo SteinkeIngo Steinke 1492 silver badges12 bronze badges 1
  • What are you ultimately trying to achieve? There might be a better approach. – Jacob Peattie Commented Feb 21, 2020 at 0:06
Add a comment  | 

1 Answer 1

Reset to default 3

Anytime changes are saved in the Customizer, there is a customize_save_after hook.

For theme updates, you can use the upgrader_process_complete hook - you pass it various arguments including 'type' => 'theme'.

I don't think there are any WordPress-specific hooks for when files of a child theme are modified. This typically happens via FTP, rather than wp-admin, so it wouldn't have any hooks. You could possibly write something yourself to check the server's modified timestamp on all the theme files, but that might be fairly server-intensive to check frequently.

发布评论

评论列表(0)

  1. 暂无评论