401 ) ); }; } /** * The error returned when a user lacks permission. * * @since 0.1.0 * * @return WP_Error */ public static function forbidden(): WP_Error { return new WP_Error( 'hostkhata_forbidden', __( 'You are not allowed to do that.', 'hostkhata' ), array( 'status' => is_user_logged_in() ? 403 : 401 ) ); } }