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

I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_swit

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744728851a4590343.html

相关推荐

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

    I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_swit

    1天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信