PHP Class Awesome_Support

显示文件 Open project: awesome-support/awesome-support Class Usage Examples

Public Properties

Property Type Description
$addons array List of registered addons
$admin_notices Admin Notices object
$custom_fields WPAS_Custom_Fields Holds the WPAS_Custom_Fields instance
$php_version_required string Follow WordPress latest requirements and require PHP version 5.2 at least.
$products_sync null | WPAS_Product_Sync Only used if there is a compatible e-commerce plugin active
$session WPAS_Session Session object
$wordpress_version_required string Minimum version of WordPress required ot run the plugin

Protected Properties

Property Type Description
$error null | WP_Error Possible error message.

Public Methods

Method Description
__clone ( ) : void Throw error on object clone
__wakeup ( ) : void Disable unserializing of the class
display_error ( ) : void Display error.
instance ( ) : object Instantiate and return the unique Awesome Support object
load_plugin_textdomain ( ) : boolean Load the plugin text domain for translation.
load_theme_functions ( ) : void Load Awesome Support's theme functions if any
redirect_to_about ( ) : void Redirect to about page.
remote_notifications ( ) : void Check for remote notifications.

Private Methods

Method Description
add_error ( string $message ) : void Add error.
dependencies_loaded ( ) : boolean Check if plugin dependencies are present.
includes ( ) : void Include all files used sitewide
includes_admin ( ) : void Include all files used in admin only
init ( ) : void Instantiate the plugin
is_php_version_enough ( ) : boolean Check if the version of PHP is compatible with this addon.
is_version_compatible ( ) : boolean Check if the core version is compatible with this addon.
maybe_setup ( ) Plugin setup.
setup_constants ( ) : void Setup all plugin constants

Method Details

__clone() public method

The whole idea of the singleton design pattern is that there is a single object therefore, we don't want the object to be cloned.
Since: 3.2.5
public __clone ( ) : void
return void

__wakeup() public method

Disable unserializing of the class
Since: 3.2.5
public __wakeup ( ) : void
return void

display_error() public method

Get all the error messages and display them in the admin notices.
Since: 3.3
public display_error ( ) : void
return void

instance() public static method

Instantiate and return the unique Awesome Support object
Since: 3.2.5
public static instance ( ) : object
return object Awesome_Support Unique instance of Awesome Support

load_plugin_textdomain() public method

With the introduction of plugins language packs in WordPress loading the textdomain is slightly more complex. We now have 3 steps: 1. Check for the language pack in the WordPress core directory 2. Check for the translation file in the plugin's language directory 3. Fallback to loading the textdomain the classic way
Since: 1.0.0
public load_plugin_textdomain ( ) : boolean
return boolean True if the language file was loaded, false otherwise

load_theme_functions() public method

Load Awesome Support's theme functions if any
Since: 3.2.0
public load_theme_functions ( ) : void
return void

redirect_to_about() public method

Redirect the user to the about page after plugin activation.
public redirect_to_about ( ) : void
return void

remote_notifications() public method

Use the Remote Dashboard Notifications plugin to check for possible notifications from http://getawesomesupport.com
public remote_notifications ( ) : void
return void

Property Details

$addons public_oe property

List of registered addons
Since: 3.3
public array $addons
return array

$admin_notices public_oe property

Admin Notices object
Since: 3.1.5
public $admin_notices

$custom_fields public_oe property

Holds the WPAS_Custom_Fields instance
Since: 3.3
public WPAS_Custom_Fields $custom_fields
return WPAS_Custom_Fields

$error protected_oe property

Possible error message.
Since: 3.3
protected null|WP_Error $error
return null | WP_Error

$php_version_required public_oe property

Follow WordPress latest requirements and require PHP version 5.2 at least.
Since: 3.3
public string $php_version_required
return string

$products_sync public_oe property

Only used if there is a compatible e-commerce plugin active
Since: 3.3
public null|WPAS_Product_Sync $products_sync
return null | WPAS_Product_Sync

$session public_oe property

Session object
Since: 3.2.6
public WPAS_Session $session
return WPAS_Session

$wordpress_version_required public_oe property

Minimum version of WordPress required ot run the plugin
Since: 3.3
public string $wordpress_version_required
return string