rest_authorization_required_code() ) ); } return true; } /** * Whether the current user has the write capability, needed to change settings and to stop a batch. * * @return bool|\WP_Error */ public static function can_change() { $read = self::can_read(); if ( true !== $read ) { return $read; } if ( ! current_user_can( self::write_capability() ) ) { return new \WP_Error( 'recast_forbidden', __( 'You do not have permission to make this change.', 'recast-subscriptions' ), array( 'status' => 403 ) ); } return true; } }