PHP Класс Awesome_Support

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$error null | WP_Error Possible error message.

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
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

Описание методов

__clone() публичный Метод

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.
С версии: 3.2.5
public __clone ( ) : void
Результат void

__wakeup() публичный Метод

Disable unserializing of the class
С версии: 3.2.5
public __wakeup ( ) : void
Результат void

display_error() публичный Метод

Get all the error messages and display them in the admin notices.
С версии: 3.3
public display_error ( ) : void
Результат void

instance() публичный статический Метод

Instantiate and return the unique Awesome Support object
С версии: 3.2.5
public static instance ( ) : object
Результат object Awesome_Support Unique instance of Awesome Support

load_plugin_textdomain() публичный Метод

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
С версии: 1.0.0
public load_plugin_textdomain ( ) : boolean
Результат boolean True if the language file was loaded, false otherwise

load_theme_functions() публичный Метод

Load Awesome Support's theme functions if any
С версии: 3.2.0
public load_theme_functions ( ) : void
Результат void

redirect_to_about() публичный Метод

Redirect the user to the about page after plugin activation.
public redirect_to_about ( ) : void
Результат void

remote_notifications() публичный Метод

Use the Remote Dashboard Notifications plugin to check for possible notifications from http://getawesomesupport.com
С версии: 3.0.0
public remote_notifications ( ) : void
Результат void

Описание свойств

$addons публичное свойство

List of registered addons
С версии: 3.3
public array $addons
Результат array

$admin_notices публичное свойство

Admin Notices object
С версии: 3.1.5
public $admin_notices

$custom_fields публичное свойство

Holds the WPAS_Custom_Fields instance
С версии: 3.3
public WPAS_Custom_Fields $custom_fields
Результат WPAS_Custom_Fields

$error защищенное свойство

Possible error message.
С версии: 3.3
protected null|WP_Error $error
Результат null | WP_Error

$php_version_required публичное свойство

Follow WordPress latest requirements and require PHP version 5.2 at least.
С версии: 3.3
public string $php_version_required
Результат string

$products_sync публичное свойство

Only used if there is a compatible e-commerce plugin active
С версии: 3.3
public null|WPAS_Product_Sync $products_sync
Результат null | WPAS_Product_Sync

$session публичное свойство

Session object
С версии: 3.2.6
public WPAS_Session $session
Результат WPAS_Session

$wordpress_version_required публичное свойство

Minimum version of WordPress required ot run the plugin
С версии: 3.3
public string $wordpress_version_required
Результат string