WordPress action hook · part of WordPress core
activated_plugin
A WordPress core action that 23 plugins also fire themselves, running on 158K+ sites between them.
“This action is documented in wp-admin/includes/plugin.php”
How to use activated_plugin
It's an action: your callback runs at that point and receives 2 arguments. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'activated_plugin', function( $plugin_file, $arg2 ) {
// Your code runs here.
}, 10, 2 );Argument names come from Event Booking Manager for WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
23 plugins that fire activated_plugin
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Hide My WP Ghost100,000+ installs
do_action( 'activated_plugin', $plugin, true )models/Rollback.php:198 -
GEO Plugin by Squirrly SEO30,000+ installs
do_action( 'activated_plugin', $plugin, false )models/Rollback.php:156 -
Event Booking Manager for WooCommerce6,000+ installs
do_action( 'activated_plugin', $plugin_file, false )admin/settings/global/admin_setting_panel.php:1214 -
ThemeHunk Customizer6,000+ installs
do_action( 'activated_plugin', $plugin )import/core/class-installation.php:141 -
Hunk Companion5,000+ installs
do_action( 'activated_plugin', $plugin )import/core/class-installation.php:141 -
Element Invader3,000+ installs
do_action( 'activated_plugin', trim( $plugin) )application/helpers/Basic.php:654 -
Cowboy MCP2,000+ installs
do_action( 'activated_plugin', $plugin, true )includes/class-mcp-compat.php:239 -
E-cab Taxi Booking Manager for Woocommerce2,000+ installs
do_action( 'activated_plugin', $plugin_file, false )Admin/settings/MPTBM_Payment_Settings.php:1807 -
Booking and Rental Manager for Bike1,000+ installs
do_action( 'activated_plugin', self::WOOCOMMERCE_PLUGIN, false )admin/settings/RBFW_Integrations_Settings.php:222 -
PlugVersions1,000+ installs
do_action( 'activated_plugin', $plugin )admin/pr-ajax-admin.php:61 -
Vayu Blocks900+ installs
do_action( 'activated_plugin', $plugin )inc/vayu-sites/core/class-installation.php:139 -
Bus Ticket Booking with Seat Reservation700+ installs
do_action( 'activated_plugin', $plugin_file, false )admin/settings/WBTM_Payment_Settings.php:1447 -
Car Rental Manager100+ installs
do_action( 'activated_plugin', $plugin_file, false )admin/settings/MPCRBM_Payment_Settings.php:1946 -
Import Members from CSV for Paid Memberships Pro80+ installs
do_action( 'activated_plugin', trim( $plugin ) )class-activateutilitiesplugin.php:98 -
MultilingualPress50+ installs
do_action( 'activated_plugin', $plugin, false )inc/copy-site/Mlp_Duplicate_Blogs.php:378 -
WP Optimize Speed By xTraffic50+ installs
do_action( 'activated_plugin', trim( $plugin) )Application/Service/PluginManager.php:109 -
E20R Better Members List for Paid Memberships Pro20+ installs
do_action( 'activated_plugin', trim( $plugin ) )ActivateUtilitiesPlugin.php:118 -
CYB Mail10+ installs
do_action( 'activated_plugin', trim($plugin) )core/classes/Addon.php:48 -
Plugin Test Drive10+ installs
do_action( 'activated_plugin', trim( $ptd_option ) )admin/options.php:176 -
hiWeb Core10+ installs
do_action( 'activated_plugin', trim( $path) )inc/hiweb-core-plugins.php:247 -
Plugin Bundles10+ installs
do_action( 'activated_plugin', trim($plugin) )includes/bundles_overview.php:292 -
Affiliate Promotions10+ installs
do_action( 'activated_plugin', trim($plugin) )affiliate-promotions.php:400 -
Yacht Booking SystemFewer than 10 installs
do_action( 'activated_plugin', $plugin_file, false )includes/Rest/SettingsController.php:291
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.