On this page
WP_REST_Global_Styles_Controller::check_update_permission( WP_Post $post ): bool
Checks if a global style can be edited.
Parameters
$postWP_Post Required-
Post object.
Return
bool Whether the post can be edited.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php. View all references
protected function check_update_permission( $post ) {
return current_user_can( 'edit_post', $post->ID );
}
Related
Uses
| Uses | Description |
|---|---|
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
Used By
| Used By | Description |
|---|---|
| WP_REST_Global_Styles_Controller::get_item_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php | Checks if a given request has access to read a single global style. |
| WP_REST_Global_Styles_Controller::update_item_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php | Checks if a given request has access to write a single global styles config. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/check_update_permission