The Air Navigation Order is a National document that is superceed by the EC Regulation. CAP 804 is defunct as far as EU regulation goes
Article 7 of the Basic Regulation:
2. Except when under training, a person may only act as a pilot
if he or she holds a licence and a medical certificate appropriate
to the operation to be performed.
A student is acting as a pilot and does therefore meet the definition of a passenger.
Annex IV to the Aircrew Regulation
Requirements for medical certificates
MED.A.030 Medical certificates
(a) A student pilot shall not fly solo unless that student pilot holds a medical certificate, as required for the relevant licence.
(b) Applicants for and holders of a light aircraft pilot licence (LAPL) shall hold at least an LAPL medical certificate.
(c) Applicants for and holders of a private pilot licence (PPL), a sailplane pilot licence (SPL), or a balloon pilot licence (BPL) shall hold at least a Class 2 medical certificate.
(f) Applicants for and holders of a commercial pilot licence (CPL), a multi-crew pilot licence (MPL), or an airline transport pilot licence (ATPL) shall hold a Class 1 medical certificate.
The holder of a PPL may exercise the privileges of the licence given in FCL.205.A (above)