q("DELETE FROM `addon` WHERE `name` = '%s' ",
dbesc($plugin)
);
-
+
+ // define THISPLUGIN, make life easy to plugin devs :-)
+ define("THISPLUGIN", 'addon/' . $plugin . '/' . $plugin . '.php');
+
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
if(function_exists($plugin . '_uninstall')) {
$func = $plugin . '_uninstall';
if (! function_exists('install_plugin')){
function install_plugin($plugin) {
-
// silently fail if plugin was removed
+ // define THISPLUGIN, make life easy to plugin devs :-)
+ define("THISPLUGIN", 'addon/' . $plugin . '/' . $plugin . '.php');
+
if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php'))
return false;
logger("Addons: installing " . $plugin);
$pl = trim($pl);
$fname = 'addon/' . $pl . '/' . $pl . '.php';
-
+
+ // define THISPLUGIN, make life easy to plugin devs :-)
+ define("THISPLUGIN", $fname);
+
if(file_exists($fname)) {
$t = @filemtime($fname);
foreach($installed as $i) {
if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) {
foreach($a->hooks[$name] as $hook) {
+ // define THISPLUGIN, make life easy to plugin devs :-)
+ define("THISPLUGIN", $hook[0]);
@include_once($hook[0]);
if(function_exists($hook[1])) {
$func = $hook[1];