PHP Класс WPCOM_VIP_Jetpack_Mandatory, vip-mu-plugins-public

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

Защищенные свойства (Protected)

Свойство Тип Описание
$mandatory_modules array An array of mandatory module names

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

Метод Описание
__construct ( ) Class constructor. Handles hooking actions and filters.
action_admin_footer ( ) Hooks the WP admin_footer action to add our list table JS template.
action_admin_footer_early ( ) Hooks the WP admin_footer action early to output JSON encoded JS data listing the mandatory modules, this is used by our JS template.
action_load_jetpack_modules ( ) =====
add_mandatory_modules ( array $modules ) : array Takes an array of module slugs and adds our mandatory modules if they are not already present.
filter_jetpack_get_default_modules ( array $modules ) : array Hooks the JP jetpack_get_default_modules filter to add in our mandatory modules to the array.
filter_pre_update_option_jetpack_active_modules ( array $modules ) : array Hooks the WP pre_update filter on the jetpack_active_modules option to add in our mandatory modules to the array.
get_mandatory_modules ( ) : array A getter for the mandatory_modules property.
init ( ) : WPCOM_VIP_Jetpack_Mandatory Initiate an instance of this class if one doesn't exist already. Return the WPCOM_VIP_Jetpack_Mandatory instance.
js_templates ( ) Provides a JS template for the JP module listing template. This overrides the JP template of the same purpose.

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

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

Class constructor. Handles hooking actions and filters.
public __construct ( )

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

=====

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

Takes an array of module slugs and adds our mandatory modules if they are not already present.
public add_mandatory_modules ( array $modules ) : array
$modules array An array of Jetpack module slugs
Результат array An array of Jetpack module slugs

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

Hooks the JP jetpack_get_default_modules filter to add in our mandatory modules to the array.
public filter_jetpack_get_default_modules ( array $modules ) : array
$modules array An array of Jetpack module slugs
Результат array An array of Jetpack module slugs

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

Hooks the WP pre_update filter on the jetpack_active_modules option to add in our mandatory modules to the array.
public filter_pre_update_option_jetpack_active_modules ( array $modules ) : array
$modules array An array of Jetpack module slugs
Результат array An array of Jetpack module slugs

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

A getter for the mandatory_modules property.
public get_mandatory_modules ( ) : array
Результат array An array of mandatory Jetpack module slugs

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

Initiate an instance of this class if one doesn't exist already. Return the WPCOM_VIP_Jetpack_Mandatory instance.
public static init ( ) : WPCOM_VIP_Jetpack_Mandatory
Результат WPCOM_VIP_Jetpack_Mandatory object The instance of WPCOM_VIP_Jetpack_Mandatory

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

This template is copied from the Jetpack_Modules_List_Table::js_templates with minor tweaks to not show the deactivate button if the module is mandatory.
public js_templates ( )

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

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

An array of mandatory module names
protected array $mandatory_modules
Результат array