Class Plugin
This class represents the plugin itself. Broadly, this module handles practically all interaction with the platform (WP), loading assets as needed, and hooking into the platforms interface to provide menus etc.
It also provides a number of helpful utility functions.
public
|
|
public
|
|
public
|
#
loadScripts( )
This function will cause the plugin scripts to be loaded. Firstly it will initialize an instance of ScriptLoader. If the developer mode setting is enabled, the scripts will be rebuilt. |
public
array
|
#
getDefaultSettings( )
Gets the default settings, passed through the wpgmza_plugin_get_default_settings filter. |
public
array
|
#
getLocalizedData( )
Gets the plugins localized data, that is, the data to be initialized as globals client side (for JavaScript). These variables will be made available as JavaScript globals, through wp_localize_script. |
public
string|null
|
#
getCurrentPage( )
Returns a string stating the current page, relevant to this plugin. Please refer to the constants on this class for a list of available pages. If the current page is not relevant to this plugin, NULL is returned. |
public
boolean
|
|
public
boolean
|
#
isInDeveloperMode( )
Returns true if the developer mode setting is checked, or if the developer mode cookie is set. |
public
boolean
|
|
public
string
|
#
getBasicVersion( )
Returns the plugin version, based on the plugin comment header. This value will be cached if it hasn't been read already. |
public
string
|
#
onLoadTextDomainMOFile( string $mofile, string $domain )
Hooks into load_textdomain_mofile, this function is used to override the WordPress repo translations and force the translations bundled with our plugin to be used. These are more complete and accurate than the WordPress community translations. |
string |
PAGE_MAP_LIST
|
#
"map-list"
|
string |
PAGE_MAP_EDIT
|
#
"map-edit"
|
string |
PAGE_SETTINGS
|
#
"map-settings"
|
string |
PAGE_SUPPORT
|
#
"map-support"
|
string |
PAGE_CATEGORIES
|
#
"categories"
|
string |
PAGE_ADVANCED
|
#
"advanced"
|
string |
PAGE_CUSTOM_FIELDS
|
#
"custom-fields"
|
public static
boolean
|
$enqueueScriptsFired
|
#
false
|
public
array
|
$settings
The plugins global settings. Please note this will be dropped and handed over to the GlobalSettings module in 7.11.00. This should not effect interaction with this property - you can continue to access this as an array safely. |
|
protected
|
$scriptLoader
An instance of ScriptLoader, used internally. |
|
protected
|
$restAPI
An instance of RestAPI, used internally. |
public read-only
string
|
$spatialFunctionPrefix
MySQL versions 8 and above prefix all spatial functions with ST_, previous versions do not. This property will be ST_ where necessary, and an empty string where not. You should use this with all DB calls that make use of spaital functions. |
public read-only
string
|
$gdprCompliance
An instance of the GDPRCompliance class. |