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


Class file image Download

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

//some plugin data
$data['name'] = "First plugin";
$data['author'] = "Nemanja";
$data['url'] = "";

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

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

//add hook, where to execute a function

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