Explorar el Código

sort staff and client by first name

master
patrick hace 6 años
padre
commit
b2d917036d
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. +3
    -3
      ts.php

+ 3
- 3
ts.php Ver fichero

@@ -189,7 +189,7 @@ class AcareOffice{
'users' => [],
);
//search all users that are staff
$staffq = new \WP_User_Query(array('role'=>'staff'));
$staffq = new \WP_User_Query(array('role'=>'staff','meta_key'=>'first_name', 'orderby'=>'meta_value', order=>'ASC'));
$staff = $staffq->get_results();
if (! empty($staff)){
$response['status'] = 'success';
@@ -220,7 +220,7 @@ class AcareOffice{
'users' => [],
);
//search all users that are staff
$clientq = new \WP_User_Query(array('role'=>'client'));
$clientq = new \WP_User_Query(array('role'=>'client', 'meta_key'=>'first_name', 'orderby'=>'meta_value', order=>'ASC'));
$client = $clientq->get_results();
if (! empty($client)){
$response['status'] = 'success';
@@ -246,7 +246,7 @@ class AcareOffice{
private function get_people_by_role($role){
//search all users that are staff
$staffq = new \WP_User_Query(array('role'=>$role));
$staffq = new \WP_User_Query(array('role'=>$role, 'meta_key'=>'first_name', 'orderby'=>'meta_value', order=>'ASC'));
$staff = $staffq->get_results();
return $staff;
}

Cargando…
Cancelar
Guardar