コード例 #1
0
ファイル: init_plugins.php プロジェクト: hardkap/pritlog
$SHP->developer_set_hook('hook-forgotpass-fail');
$SHP->developer_set_hook('hook-activation-success');
$SHP->developer_set_hook('hook-activation-fail');
$SHP->developer_set_hook('hook-searchposts-replace');
$SHP->developer_set_hook('hook-commentform');
$SHP->developer_set_hook('hook-commentform-replace');
$SHP->developer_set_hook('hook-comment-validate');
$SHP->developer_set_hook('hook-comment-success');
$SHP->developer_set_hook('hook-comment-replace');
$SHP->developer_set_hook('hook-comment-fail');
$SHP->developer_set_hook('hook-deletecomment');
$SHP->developer_set_hook('hook-delete-entry');
//set multiple hooks to which plugin developers can assign functions
//$SHP->developer_set_hooks(array('test1','test2', 'with_args'));
//load plugins from folder, if no argument is supplied, a './plugins/' constant will be used
//trailing slash at the end is REQUIRED!
//this method will load all *.plugin.php files from given directory, INCLUDING subdirectories
$SHP->load_plugins(getcwd() . "/plugins/");
//now, this is a workaround because plugins, when included, can't access $SHP variable, so we
//as developers have to basically redefine functions which can be called from plugin files
function add_hook($pluginid, $where, $function)
{
    global $SHP;
    $SHP->add_hook($pluginid, $where, $function);
}
//same as above
function register_plugin($plugin_id, $data)
{
    global $SHP;
    $SHP->register_plugin($plugin_id, $data);
}