Свойство | Type | Description | |
---|---|---|---|
$namespace | string | Endpoint namespace. | |
$post_type | string | Post type. | |
$rest_base | string | Route base. |
Méthode | Description | |
---|---|---|
__construct ( ) | Order refunds actions. | |
create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Create a single item. | |
get_collection_params ( ) : array | Get the query params for collections of attachments. | |
get_item_schema ( ) : array | Get the Coupon's schema, conforming to JSON Schema. | |
prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response | Prepare a single coupon output for response. | |
query_args ( array $args, WP_REST_Request $request ) : array | Query args. | |
register_routes ( ) | Register the routes for coupons. | |
save_coupon ( $request ) | Saves a coupon to the database. | |
update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Update a single coupon. |
Méthode | Description | |
---|---|---|
filter_writable_props ( array $schema ) : boolean | Only reutrn writeable props from schema. | |
prepare_item_for_database ( WP_REST_Request $request ) : WP_Error | stdClass | Prepare a single coupon for create or update. |
public create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
Résultat | WP_Error | WP_REST_Response |
protected filter_writable_props ( array $schema ) : boolean | ||
$schema | array | |
Résultat | boolean |
public get_collection_params ( ) : array | ||
Résultat | array |
public get_item_schema ( ) : array | ||
Résultat | array |
protected prepare_item_for_database ( WP_REST_Request $request ) : WP_Error | stdClass | ||
$request | WP_REST_Request | Request object. |
Résultat | WP_Error | stdClass | $data Post object. |
public prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response | ||
$post | WP_Post | Post object. |
$request | WP_REST_Request | Request object. |
Résultat | WP_REST_Response | $data |
public query_args ( array $args, WP_REST_Request $request ) : array | ||
$args | array | |
$request | WP_REST_Request | |
Résultat | array |
public update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full details about the request. |
Résultat | WP_Error | WP_REST_Response |