/** * This function scans the connector plugins directory and adds the plugin to the plugin helper * */ function install_plugins() { global $ai1ec_importer_plugin_helper; // Scan the plugin directory for php files foreach (glob(AI1EC_IMPORT_PLUGIN_PATH . "/*.php") as $filename) { // The class name should be the same as the php file $class_name = Ai1ec_String_Utility::classify($filename); // If the class exist if (class_exists($class_name) && is_subclass_of($class_name, 'Ai1ec_Connector_Plugin')) { // Instantiate a new object and add it as a plugin. // In the constructor the plugin will add his hooks. $ai1ec_importer_plugin_helper->add_plugin(new $class_name()); } } $ai1ec_importer_plugin_helper->sort_plugins(); }