Core::getPluginSettings PHP Method

getPluginSettings() public static method

Added in 3.1.4. This allows any plugins to have custom settings defined in $pluginSettings. This function returns null if no settings exist for the plugin, or whatever settings have been provided.
public static getPluginSettings ( $pluginType, $pluginFolder ) : mixed
$pluginType
$pluginFolder
return mixed
    public static function getPluginSettings($pluginType, $pluginFolder)
    {
        if (!array_key_exists($pluginType, self::$pluginSettings)) {
            return null;
        }
        if (!array_key_exists($pluginFolder, self::$pluginSettings[$pluginType])) {
            return null;
        }
        return self::$pluginSettings[$pluginType][$pluginFolder];
    }

Usage Example

示例#1
0
 public function __construct()
 {
     $customPluginSettings = Core::getPluginSettings(Constants::PLUGIN_DATA_TYPE, "Date");
     if (isset($customPluginSettings["useSafeDates"]) && $customPluginSettings["useSafeDates"]) {
         self::$useSafeDates = true;
     }
 }