WP_REST_Global_Styles_Controller::check_read_permission
Checks if a global style can be read.
Method of the class: WP_REST_Global_Styles_Controller{}
No Hooks.
Returns
true|false. Whether the post can be read.
Usage
$WP_REST_Global_Styles_Controller = new WP_REST_Global_Styles_Controller(); $WP_REST_Global_Styles_Controller->check_read_permission( $post );
- $post(WP_Post) (required)
- Post object.
Changelog
| Since 5.9.0 | Introduced. |
WP_REST_Global_Styles_Controller::check_read_permission() WP REST Global Styles Controller::check read permission code WP 6.9.1
public function check_read_permission( $post ) {
return current_user_can( 'read_post', $post->ID );
}