Running several plugins from one "wrapper" plugin

Hi,

I am currently using a booking plugin which unfortunately requires 3 individual plugins to run the "full version" of functionality.

I will be providing this booking functionality to my users on the sub sites but do not want them to have to activate 3 plugins. Is there a way of creating a wrapper plugin to allow the users to activate all three. I can hide the original three with Pro-sites.

  • Jamie

    After a bunch of google searches I solved this one. Here is the code that I used, maybe it is helpful for others.

    register_activation_hook( __FILE__, 'my_booking_activate' );
    register_deactivation_hook( __FILE__, 'my_booking_deactivate' );
    
    function my_booking_activate() {
        foreach (my_get_complemente() as $plugin){
            $plugin_path = WP_PLUGIN_DIR . '/' . $plugin . '/index.php';
            activate_plugin($plugin_path);
        }
    }
    
    function my_booking_deactivate() {
        add_action('update_option_active_plugins', 'my_deactivate_dependents');
        }
    
    function my_deactivate_dependents(){
    
            foreach (my_get_complemente() as $plugin) {
                $plugin_path = plugin_basename(WP_PLUGIN_DIR . '/' . $plugin . '/index.php');
                deactivate_plugins($plugin_path);
            }
    }
    
    function my_get_complemente() {
        return array('plugin-a',  'plugin-b',  'plugin-c');
    }

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.