WordPress at a glance
function is not described

WP_REST_Posts_Controller::check_update_permission() protected WP 4.7.0

Checks if a post can be edited.

{} It's a method of the class: WP_REST_Posts_Controller{}

No Hooks.

Return

true/false. Whether the post can be edited.

Usage

// protected - for code of main (parent) or child class
$result = $this->check_update_permission( $post );
$post(WP_Post) (required)
Post object.

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Posts_Controller::check_update_permission() WP 5.5.1

<?php
protected function check_update_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( 'edit_post', $post->ID );
}