Skip to content

Commit

Permalink
fix php cs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Feb 14, 2024
1 parent 1252a48 commit 3d32767
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,16 @@ protected function prepare_revision_links( $template ) {
*
* @since 6.5
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
*/
public function get_items_permissions_check( $request ) {
public function get_items_permissions_check() {
/*
* Allow access to anyone who can edit posts.
*/
if ( ! current_user_can( 'edit_posts' ) ) {
return new WP_Error(
'rest_cannot_manage_templates',
__( 'Sorry, you are not allowed to access the templates on this site.' ),
__( 'Sorry, you are not allowed to access the templates on this site.', 'default' ),
array(
'status' => rest_authorization_required_code(),
)
Expand All @@ -103,17 +102,16 @@ public function get_items_permissions_check( $request ) {
*
* @since 6.5
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
*/
public function get_item_permissions_check( $request ) {
public function get_item_permissions_check() {
/*
* Allow access to anyone who can edit posts.
*/
if ( ! current_user_can( 'edit_posts' ) ) {
return new WP_Error(
'rest_cannot_manage_templates',
__( 'Sorry, you are not allowed to access the templates on this site.' ),
__( 'Sorry, you are not allowed to access the templates on this site.', 'default' ),
array(
'status' => rest_authorization_required_code(),
)
Expand Down

0 comments on commit 3d32767

Please sign in to comment.