Collections functions
General functions
Render functions
Theme permission functions
User functions
Resource functions

get_plugin_path()

Parameters

ColumnTypeDefaultDescription
$plugin
$url false

Location

include/plugin_functions.php lines 1444 to 1460

Definition

 
function get_plugin_path($plugin,$url=false)
    {
    
# For the given plugin shortname, return the path on disk
    # Supports plugins being in the filestore folder (for user uploaded plugins)
    
global $baseurl_short,$storagedir,$storageurl;
    
    
# Sanitise $plugin
    
$plugin=safe_file_name($plugin);
    
    
# Standard location    
    
$pluginpath=dirname(__FILE__) . "/../plugins/" $plugin;
    if (
file_exists($pluginpath)) {return ($url?$baseurl_short "plugins/" $plugin:$pluginpath);}

    
# Filestore location
    
$pluginpath=$storagedir "/plugins/" $plugin;
    if (
file_exists($pluginpath)) {return ($url?$storageurl "/plugins/" $plugin:$pluginpath);}
    }

This article was last updated 28th November 2023 10:05 Europe/London time based on the source file dated 7th September 2023 11:45 Europe/London time.