activated_plugin

動作鉤子
do_action( 'activated_plugin', $plugin, $network_wide )
引數
  • (string) $plugin Path to the plugin file relative to the plugins directory.
    Required:
  • (bool) $network_wide Whether to enable the plugin for all sites in the network or just the current site. Multisite only. Default false.
    Required:
定義位置
相關勾子
deactivated_pluginactivate_plugindeactivate_pluginactivate_blogdeactivate_blog
相關方法
activate_pluginactivate_pluginsdeactivate_pluginsactivate_sitewide_plugindeactivate_sitewide_plugindeactivated_plugins_notice
引入
2.9.0
棄用
-

activated_plugin是一個動作鉤子,當一個外掛從WordPress的外掛管理介面被啟用時被觸發。

在一個外掛被啟用後啟動。

如果一個外掛被默默地啟用(例如在更新期間),這個鉤子就不會啟動。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'activated_plugin', $plugin, $network_wide );
do_action( 'activated_plugin', $plugin, $network_wide );
do_action( 'activated_plugin', $plugin, $network_wide );

常見問題

FAQs
檢視更多 >