Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tnomi

    (@tnomi)

    Thank you for your feedback.
    But sorting option is still undecided.

    Thread Starter xmmassage

    (@xmmassage)

    Here is my own change of your code. In my case i was needed to sort them by display name.

    public function get_all_staff( $args = null ) {
    $meta = array(
    ‘meta_query’ => array(
    array(
    ‘key’ => ATTMGR::PLUGIN_ID.’_ex_attr_staff’,
    ‘value’ => 1,
    ‘compare’ => ‘=’
    ),
    ),

    /**
    * My addon
    */

    ‘meta_key’ => ‘first_name’,
    ‘orderby’ => ‘display_name’,
    ‘order’ => ‘ASC’

    );
    $user_query = new WP_User_Query( $meta );
    $users = $user_query->results;
    $staff = array();
    if ( ! empty( $users ) ) {
    foreach ( $users as $u ) {
    if ( ! empty( $u->ID ) ) {
    $user = new ATTMGR_User( $u->ID );
    //if ( $user->is_staff() ) {
    $staff[] = $user;
    //}
    }
    }
    }
    return $staff;
    }

    Plugin Author tnomi

    (@tnomi)

    Thank you very much.
    I would like to think about adding a parameter to shortcode [attmgr_admin_scheduler].

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Users sorting option’ is closed to new replies.