WP_REST_Global_Styles_Controller::check_update_permission() WordPress Method
The WP_REST_Global_Styles_Controller::check_update_permission() method checks if a given user has permission to update global styles. This is useful for making sure that only authorized users can make changes to global styles that could affect the appearance of a site.
WP_REST_Global_Styles_Controller::check_update_permission( WP_Post $post ) #
Checks if a global style can be edited.
Parameters
- $post
(WP_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
protected function check_update_permission( $post ) { return current_user_can( 'edit_post', $post->ID ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |