Overview

Namespaces

  • None
  • WPGMZA
    • Integration
    • Selector

Classes

  • AutoLoader
  • Crud
  • DOMDocument
  • DOMElement
  • Factory
  • GDPRCompliance
  • GoogleGeocoder
  • GoogleMap
  • GoogleMapsAPILoader
  • GoogleMapsLoader
  • LatLng
  • Map
  • MapsEngineDialog
  • Marker
  • ModalDialog
  • NominatimGeocodeCache
  • OLLoader
  • Plugin
  • RestAPI
  • ScriptLoader
  • Strings

Functions

  • create_marker_instance_delegate
  • create_plugin_instance
  • query_nominatim_cache
  • store_nominatim_cache
  • Overview
  • Namespace
  • Class

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.

Namespace: WPGMZA
Located at class.plugin.php
Methods summary
public
# __construct( )

Constructor. Called when plugins_loaded fires.

Constructor. Called when plugins_loaded fires.

public
# __get( $name )

Getter, see property-read above.

Getter, see property-read above.

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.

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.

If any of the enqueue scripts, admin enqueue scripts or enqueue block assets (Gutenberg) actions have already fired, this function will immediately ask the script loader to enqueue the plugins scripts and styles.

If none of those actions have fired yet, this function will bind to all three and enqueue the scripts at the correct time.

public array
# getDefaultSettings( )

Gets the default settings, passed through the wpgmza_plugin_get_default_settings filter.

Gets the default settings, passed through the wpgmza_plugin_get_default_settings filter.

Returns

array
An array of key value pairs with the default plugin settings.
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.

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.

This array is passed through the filter wpgmza_plugin_get_localized_data.

Returns

array
A key value array of variables to be passed to JavaScript.
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.

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.

Returns

string|null
The current page, where relevant to this plugin, or null
public boolean
# isUsingMinifiedScripts( )

Returns true if we are to be using combined or minified JavaScript

Returns true if we are to be using combined or minified JavaScript

Returns

boolean
True if combined or minified scripts are to be used.
public boolean
# isInDeveloperMode( )

Returns true if the developer mode setting is checked, or if the developer mode cookie is set.

Returns true if the developer mode setting is checked, or if the developer mode cookie is set.

Returns

boolean
True if in developer mode, by setting or by cookie.
public boolean
# isProVersion( )

Check whether we are running the Pro add-on.

Check whether we are running the Pro add-on.

Returns

boolean
True if the Pro add-on is installed and activated.
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.

Returns the plugin version, based on the plugin comment header. This value will be cached if it hasn't been read already.

Returns

string
The version string.
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.

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.

Parameters

$mofile
Path to the .mo file in question.
$domain
The text domain

Returns

string
Constants summary
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"
Properties summary
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.

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.

Deprecated

Will be read-only and an instance of GLobalSettings as of 7.11.00
#
protected WPGMZA\ScriptLoader $scriptLoader

An instance of ScriptLoader, used internally.

An instance of ScriptLoader, used internally.

#
protected WPGMZA\RestAPI $restAPI

An instance of RestAPI, used internally.

An instance of RestAPI, used internally.

#
Magic properties summary
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.

API documentation generated by ApiGen