Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_plugin_config()

Description

Return plugin config stored in plugins table for a given plugin name.

Queries the plugins table for a stored config value and, if found,
unserializes the data and returns the result. If config isn't found
returns null.

@see set_plugin_config

Parameters

ColumnTypeDefaultDescription
$name string Plugin name

Return

mixed|null Returns config data or null if no config.

Location

include/plugin_functions.php lines 293 to 319

Definition

 
function get_plugin_config($name){
    global 
$mysql_verbatim_queries$mysql_charset;

    
# Need verbatum queries here
    
$mysql_vq $mysql_verbatim_queries;
    
$mysql_verbatim_queries true;
    
$configs sql_query("SELECT config,config_json from plugins where name='$name'"'plugins');
    
$configs $configs[0];
    
$mysql_verbatim_queries $mysql_vq;
    if (!
array_key_exists('config'$configs))
        {
        return 
null;
        }
    elseif (
array_key_exists('config_json'$configs) && function_exists('json_decode'))
        {
        if (!isset(
$mysql_charset))
            {
            
$configs['config_json'] = iconv('ISO-8859-1''UTF-8'$configs['config_json']);
            }
            return 
json_decode($configs['config_json'], true);

        }
    else
        {
        return 
unserialize(base64_decode($configs['config']));
        }
}

This article was last updated 30th November 2020 19:35 Europe/London time based on the source file dated 9th October 2020 10:20 Europe/London time.