PHP 클래스 WP_REST_Revisions_Controller, wordpress

상속: extends WP_REST_Controller
파일 보기 프로젝트 열기: johnpbloch/wordpress 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $parent_post_type ) Constructor.
delete_item ( WP_REST_Request $request ) : true | WP_Error Deletes a single revision.
delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error Checks if a given request has access to delete a revision.
get_collection_params ( ) : array Retrieves the query params for collections.
get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error Retrieves one revision from the collection.
get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error Checks if a given request has access to get a specific revision.
get_item_schema ( ) : array Retrieves the revision's schema, conforming to JSON Schema.
get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error Gets a collection of revisions.
get_items_permissions_check ( WP_REST_Request $request ) : true | WP_Error Checks if a given request has access to get revisions.
prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response Prepares the revision for the REST response.
register_routes ( ) Registers routes for revisions based on post types supporting revisions.

보호된 메소드들

메소드 설명
prepare_date_response ( string $date_gmt, string | null $date = null ) : string | null Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output.
prepare_excerpt_response ( string $excerpt, WP_Post $post ) : string Checks the post excerpt and prepare it for single post output.

메소드 상세

__construct() 공개 메소드

Constructor.
부터: 4.7.0
public __construct ( string $parent_post_type )
$parent_post_type string Post type of the parent.

delete_item() 공개 메소드

Deletes a single revision.
부터: 4.7.0
public delete_item ( WP_REST_Request $request ) : true | WP_Error
$request WP_REST_Request Full details about the request.
리턴 true | WP_Error True on success, or WP_Error object on failure.

delete_item_permissions_check() 공개 메소드

Checks if a given request has access to delete a revision.
부터: 4.7.0
public delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error
$request WP_REST_Request Full details about the request.
리턴 boolean | WP_Error True if the request has access to delete the item, WP_Error object otherwise.

get_collection_params() 공개 메소드

Retrieves the query params for collections.
부터: 4.7.0
public get_collection_params ( ) : array
리턴 array Collection parameters.

get_item() 공개 메소드

Retrieves one revision from the collection.
부터: 4.7.0
public get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error
$request WP_REST_Request Full data about the request.
리턴 WP_REST_Response | WP_Error Response object on success, or WP_Error object on failure.

get_item_permissions_check() 공개 메소드

Checks if a given request has access to get a specific revision.
부터: 4.7.0
public get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error
$request WP_REST_Request Full data about the request.
리턴 boolean | WP_Error True if the request has read access for the item, WP_Error object otherwise.

get_item_schema() 공개 메소드

Retrieves the revision's schema, conforming to JSON Schema.
부터: 4.7.0
public get_item_schema ( ) : array
리턴 array Item schema data.

get_items() 공개 메소드

Gets a collection of revisions.
부터: 4.7.0
public get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error
$request WP_REST_Request Full data about the request.
리턴 WP_REST_Response | WP_Error Response object on success, or WP_Error object on failure.

get_items_permissions_check() 공개 메소드

Checks if a given request has access to get revisions.
부터: 4.7.0
public get_items_permissions_check ( WP_REST_Request $request ) : true | WP_Error
$request WP_REST_Request Full data about the request.
리턴 true | WP_Error True if the request has read access, WP_Error object otherwise.

prepare_date_response() 보호된 메소드

Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output.
부터: 4.7.0
protected prepare_date_response ( string $date_gmt, string | null $date = null ) : string | null
$date_gmt string GMT publication time.
$date string | null Optional. Local publication time. Default null.
리턴 string | null ISO8601/RFC3339 formatted datetime, otherwise null.

prepare_excerpt_response() 보호된 메소드

Checks the post excerpt and prepare it for single post output.
부터: 4.7.0
protected prepare_excerpt_response ( string $excerpt, WP_Post $post ) : string
$excerpt string The post excerpt.
$post WP_Post Post revision object.
리턴 string Prepared excerpt or empty string.

prepare_item_for_response() 공개 메소드

Prepares the revision for the REST response.
부터: 4.7.0
public prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response
$post WP_Post Post revision object.
$request WP_REST_Request Request object.
리턴 WP_REST_Response Response object.

register_routes() 공개 메소드

Registers routes for revisions based on post types supporting revisions.
또한 보기: register_rest_route()
부터: 4.7.0
public register_routes ( )