简体   繁体   中英

action for installing plugin in wordpress

In wordpress there are actions that are fires when we activated and deactivated plugin (activated_plugin, deactivated_plugin). Is there any action that is fired when we install some new plugin?

There doesn't seem to be any action you can hook into while a plugin is being installed, but there are a few filters.

  1. apply_filters( 'plugins_api_args', $args, $action );
  2. apply_filters( 'plugins_api', false, $action, $args );
  3. apply_filters( 'plugins_api_result', $res, $action, $args );

This is the function that handles the ajax plugin install request wp_ajax_install_plugin

The filters are located inside the plugins_api

Hope this gives you enough tools to run the code that you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM