HTTP/2 200
server: nginx
date: Wed, 15 Oct 2025 05:02:34 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
WP_REST_Posts_Controller::check_create_permission() – Method | Developer.WordPress.org
WordPress Developer Resources
WP_REST_Posts_Controller::check_create_permission()
WP_REST_Posts_Controller::check_create_permission( WP_Post $post ): bool
Checks if a post can be created.
bool Whether the post can be created.
protected function check_create_permission( $post ) {
$post_type = get_post_type_object( $post->post_type );
if ( ! $this->check_is_post_type_allowed( $post_type ) ) {
return false;
}
return current_user_can( $post_type->cap->create_posts );
}
View all references View on Trac View on GitHub
Version | Description |
---|
4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.