Because you save your data as appointment-start-date
(hyphens), but in your orderby handler you use appointment_start_date
(underscores).
They need to match!
$query->set( 'meta_key', 'appointment-start-date' );
Because you save your data as appointment-start-date
(hyphens), but in your orderby handler you use appointment_start_date
(underscores).
They need to match!
$query->set( 'meta_key', 'appointment-start-date' );