PHP 클래스 Jetpack_Core_API_Module_Toggle_Endpoint, jetpack

상속: extends Jetpack_Core_API_XMLRPC_Consumer_Endpoint
파일 보기 프로젝트 열기: automattic/jetpack 1 사용 예제들

공개 메소드들

메소드 설명
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.