PHP Classes

File: plugins/plugin1.plugin.php

Recommend this page to a friend!
  Classes of Nemanja Avramovic   Simple Hooks Plugin   plugins/plugin1.plugin.php   Download  
File: plugins/plugin1.plugin.php
Role: Application script
Content type: text/plain
Description: Plugin example
Class: Simple Hooks Plugin
Setup and call application plug-in scripts
Author: By
Last change:
Date: 15 years ago
Size: 514 bytes
 

Contents

Class file image Download
<?php

//set plugin id as file name of plugin
$plugin_id = basename(__FILE__);

//some plugin data
$data['name'] = "First plugin";
$data['author'] = "Nemanja";
$data['url'] = "http://www.instant-update.com/";

//register plugin to SHP
register_plugin($plugin_id, $data);

//plugin function
function testfunc() {
    echo
'echoed from plugin<br />';
}

//add hook, where to execute a function
add_hook('test','testfunc');

//code to execute when loading plugin
echo "<p>Plugin 1 LOADED!</p>";
?>