• Hello,

    I’m using the woodojo plugin, and a couple of his bundled modules, what i’m trying to achieve is that on plugin activation, it will automatically enable one of his bundled module, the module that i want to automatically enable to the woodojo custom code.

    Is there a filter/action/function any way to make this happen? I’ve been struggling for hours and diving into the code to see if there was something and i’ve found the function into a class

    public function activate_component ( $component, $type = 'bundled', $redirect = true )

    How can i interact with this function ?

    Thank you.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I know nothing of this plugin, but here’s a few tidbits that may help you in your quest. Plugins normally use register_activation_hook() to specify what to do on activation. Locate this in the plugin code to identify the function being registered. This registered function is where any added activation activities should be specified. If register_activation_hook() is not used at all, you could define an added function and register it yourself, adding it to the plugin code.

    Note that it is very poor practice to directly hack plugin files just as it is for WP core files. Your hacks will be overwritten when the plugin is updated. I realize sometimes there is little alternative. In such cases, please do understand the ramifications and ensure there are no alternatives. Some plugin authors do provide hooks for extending their plugin.

    I’m not sure how you want to “interact” with that function. I’ve no idea what it does or what the parameters are for. I can tell you to use a class function, a class object needs to be instantiated. There may be an instance you can use already, or else you need to create one with something like $instance = new Some_Class_Name;.

    You then call the function as an object method with something like $instance->activate_component( $component );.

    Not the answer you were looking for, I know, but hopefully helps some anyway.

Viewing 1 replies (of 1 total)
  • The topic ‘Woodojo Automatic Module Activation’ is closed to new replies.