PHP 클래스 WPCOM_VIP_Jetpack_Mandatory, vip-mu-plugins-public

파일 보기 프로젝트 열기: Automattic/vip-mu-plugins-public 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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