PHP Класс Jetpack_Core_API_Module_Toggle_Endpoint, jetpack

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

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

Метод Описание
activate_module ( string | WP_REST_Request $data ) : boolean | WP_Error If it's a valid Jetpack module, activate it.
can_request ( ) : boolean Check that the current user has permissions to manage Jetpack modules.
deactivate_module ( string | WP_REST_Request $data ) : boolean | WP_Error If it's a valid Jetpack module, deactivate it.
process ( WP_REST_Request $data ) : WP_REST_Response | WP_Error Check if the module requires the site to be publicly accessible from WPCOM.

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

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

If it's a valid Jetpack module, activate it.
С версии: 4.3.0
public activate_module ( string | WP_REST_Request $data ) : boolean | WP_Error
$data string | WP_REST_Request { Array of parameters received by request. @type string $slug Module slug. }
Результат boolean | WP_Error True if module was activated. Otherwise, a WP_Error instance with the corresponding error.

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

Check that the current user has permissions to manage Jetpack modules.
С версии: 4.3.0
public can_request ( ) : boolean
Результат boolean

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

If it's a valid Jetpack module, deactivate it.
С версии: 4.3.0
public deactivate_module ( string | WP_REST_Request $data ) : boolean | WP_Error
$data string | WP_REST_Request { Array of parameters received by request. @type string $slug Module slug. }
Результат boolean | WP_Error True if module was activated. Otherwise, a WP_Error instance with the corresponding error.

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

If the site meets this requirement, the module is activated. Otherwise an error is returned.
С версии: 4.3.0
public process ( WP_REST_Request $data ) : WP_REST_Response | WP_Error
$data WP_REST_Request { Array of parameters received by request. @type string $slug Module slug. @type bool $active should module be activated. }
Результат WP_REST_Response | WP_Error A REST response if the request was served successfully, otherwise an error.