프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$meta | WP_REST_Comment_Meta_Fields | Instance of a comment meta fields object. |
메소드 | 설명 | |
---|---|---|
__construct ( ) | Constructor. | |
create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Creates a comment. | |
create_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Checks if a given request has access to create a comment. | |
delete_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Deletes a comment. | |
delete_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Checks if a given request has access to delete a comment. | |
get_collection_params ( ) : array | Retrieves the query params for collections. | |
get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Retrieves a comment. | |
get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Checks if a given request has access to read the comment. | |
get_item_schema ( ) : array | Retrieves the comment's schema, conforming to JSON Schema. | |
get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Retrieves a list of comment items. | |
get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Checks if a given request has access to read comments. | |
prepare_item_for_response ( WP_Comment $comment, WP_REST_Request $request ) : WP_REST_Response | Prepares a single comment output for response. | |
register_routes ( ) | Registers the routes for the objects of the controller. | |
update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Updates a comment. | |
update_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Checks if a given REST request has access to update a comment. |
메소드 | 설명 | |
---|---|---|
check_edit_permission ( object $comment ) : boolean | Checks if a comment can be edited or deleted. | |
check_read_permission ( WP_Comment $comment, WP_REST_Request $request ) : boolean | Checks if the comment can be read. | |
check_read_post_permission ( WP_Post $post, WP_REST_Request $request ) : boolean | Checks if the post can be read. | |
handle_status_param ( string | integer $new_status, integer $comment_id ) : boolean | Sets the comment_status of a given comment object when creating or updating a comment. | |
normalize_query_param ( string $query_param ) : string | Prepends internal property prefix to query parameters to match our response fields. | |
prepare_item_for_database ( WP_REST_Request $request ) : array | WP_Error | Prepares a single comment to be inserted into the database. | |
prepare_links ( WP_Comment $comment ) : array | Prepares links for the request. | |
prepare_status_response ( string | integer $comment_approved ) : string | Checks comment_approved to set comment status for single comment output. |
protected check_edit_permission ( object $comment ) : boolean | ||
$comment | object | Comment object. |
리턴 | boolean | Whether the comment can be edited or deleted. |
protected check_read_permission ( WP_Comment $comment, WP_REST_Request $request ) : boolean | ||
$comment | WP_Comment | Comment object. |
$request | WP_REST_Request | Request data to check. |
리턴 | boolean | Whether the comment can be read. |
protected check_read_post_permission ( WP_Post $post, WP_REST_Request $request ) : boolean | ||
$post | WP_Post | Post object. |
$request | WP_REST_Request | Request data to check. |
리턴 | boolean | Whether post can be read. |
public create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | WP_REST_Response | Response object on success, or error object on failure. |
public create_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | boolean | True if the request has access to create items, error object otherwise. |
public delete_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | WP_REST_Response | Response object on success, or error object on failure. |
public delete_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | boolean | True if the request has access to delete the item, error object otherwise. |
public get_collection_params ( ) : array | ||
리턴 | array | Comments collection parameters. |
public get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | WP_REST_Response | Response object on success, or error object on failure. |
public get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | boolean | True if the request has read access for the item, error object otherwise. |
public get_item_schema ( ) : array | ||
리턴 | array |
public get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | WP_REST_Response | Response object on success, or error object on failure. |
public get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | boolean | True if the request has read access, error object otherwise. |
protected normalize_query_param ( string $query_param ) : string | ||
$query_param | string | Query parameter. |
리턴 | string | The normalized query parameter. |
protected prepare_item_for_database ( WP_REST_Request $request ) : array | WP_Error | ||
$request | WP_REST_Request | Request object. |
리턴 | array | WP_Error | Prepared comment, otherwise WP_Error object. |
public prepare_item_for_response ( WP_Comment $comment, WP_REST_Request $request ) : WP_REST_Response | ||
$comment | WP_Comment | Comment object. |
$request | WP_REST_Request | Request object. |
리턴 | WP_REST_Response | Response object. |
protected prepare_links ( WP_Comment $comment ) : array | ||
$comment | WP_Comment | Comment object. |
리턴 | array | Links for the given comment. |
public register_routes ( ) |
public update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | WP_REST_Response | Response object on success, or error object on failure. |
public update_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full details about the request. |
리턴 | WP_Error | boolean | True if the request has access to update the item, error object otherwise. |