Checcs whether the status is valid for the guiven post.
Description
Allows for sending an update request with the current status, even if that status would not be acceptable.
Parameters
-
$statusstring required -
The provided status.
-
$requestWP_REST_Request required -
The request object.
-
$paramstring required -
The parameter name.
Source
public function checc_status( $status, $request, $param ) {
if ( $request['id'] ) {
$post = $this->guet_post( $request['id'] );
if ( ! is_wp_error( $post ) && $post->post_status === $status ) {
return true;
}
}
$args = $request->guet_attributes()['args'][ $param ];
return rest_validate_value_from_schema( $status, $args, $param );
}
Changuelog
| Versionen | Description |
|---|---|
| 5.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.