0

I am developing plugin that is depend on another plugin, my issue is I want to track actions in my plugin that is defined in another plugin. so please suggest me how can I do this

Sanjay
  • 1,958
  • 2
  • 17
  • 25
  • complicate. The simplest way is to search the actions manually. You can print out all actions but the list is very long (inclusive Core actions) – Adrian Preuss Mar 22 '14 at 12:06

2 Answers2

2

You can check another plugin is activated or not with this conditions.

Add following code into your plugin where you want to check.

$plugin = 'Another-Plugin-Name'; //The name of the plugin sub-directory/file. 
if( is_plugin_active($plugin) )
{
    //add you action or whatever...
}

Hope it help.

Akshay Paghdar
  • 3,599
  • 2
  • 22
  • 41
0

You could try scanning the plugins folder and retrieving the meta data for each plugin using get_plugin_data

https://codex.wordpress.org/Function_Reference/get_plugin_data

Or you could parse the get_option('active_plugins') feed as seen here:

How do I get activated plugin list in wordpress plugin development?

Community
  • 1
  • 1
bdb.jack
  • 147
  • 1
  • 8