phppluginsactionelgg

How to call an action from another plugin after another action from a different plugin gets called


I have two plugins: plugin_A and plugin_B. In plugin_A/actions/plugin_A/ there is an action a_action.php. In plugin_B/actions/plugin_B/ there is an action b_action.php.

plugin_A/start.php

elgg_register_action("a_action", __DIR__ . "/actions/plugin_A/a_action.php");

plugin_B/start.php

elgg_register_action("b_action", __DIR__ . "/actions/plugin_B/b_action.php");

I would like b_action to be called after anytime a_action gets called.

How can I go about this.

Thank you all in advance.


Solution

  • for that you simply call elgg function called action at the end of a_action.php

    action('b_action');