Osclass functionality could be extended via Plugins, refer to Plugins page to know more about plugins, this page is about to create them.

Plugins files structure

Each plugins should consist in one plugin folder, you can call it whatever you want, and one index.php file at least. You could add several files and libraries. Plugins use Hooks to trigger functions at several places of the Osclass code.

Making a plugin installable

To make a plugin installable you should put this function at the end of the index.php

osc_register_plugin(osc_plugin_path(__FILE__), 'custom_function_call_after_install') ;

Usage of hooks

To use a hook add the following code to your plugin file :

osc_add_hook('hook_name', 'function_name');


Substitute ‘hook_name’ by the name of the hook you want to attach ‘function_name’, and ‘function_name’ with the name of your function.

Special hooks

There exists some special hooks

This is a hack to show a Configure link at plugins table (you could also use some other hook to show a custom option panel);

osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'function_name');

This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel);

osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'function_name');

List of Hooks

Here’s a detailed list of Hooks explaining when they are triggered and which arguments are passed to the target funtions.

More information

Any doubts or comments could be placed in our Development Forum