$per_page, 'offset' => $offset, 'orderby' => 'ad_listing_count', 'order' => 'DESC', 'fields' => 'ID', ]; if ( ! empty( $agVerify ) ) { $query_args['meta_query'] = [ [ 'key' => '_ad_user_verify_status', 'value' => '1', 'compare' => '=', ], ]; } // Check if review system is enabled $enable_review = AD()->Helper->get_setting( 'enable_review' ); switch ( $agSortBy ) { case 'name_a_z': $query_args['orderby'] = 'display_name'; $query_args['order'] = 'ASC'; break; case 'name_z_a': $query_args['orderby'] = 'display_name'; $query_args['order'] = 'DESC'; break; case 'rating': // Only allow rating sorting if review system is enabled if ( ! empty( $enable_review ) ) { $args['meta_key'] = 'adqs_agent_rating'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'DESC'; } break; case 'review_count': // Only allow review count sorting if review system is enabled if ( ! empty( $enable_review ) ) { $args['meta_key'] = 'adqs_agent_review'; $args['orderby'] = 'meta_value_num'; $args['order'] = 'DESC'; } break; } // Add search functionality if ( ! empty( $agentSearch ) ) { $query_args['search'] = '*' . $agentSearch . '*'; $query_args['search_columns'] = [ 'display_name', 'user_login', 'user_email' ]; } $query_args['include'] = ! empty( $filter_datas ) ? $filter_datas : [ 0 ]; // Query users $user_query = new WP_User_Query( $query_args ); $authors = $user_query->get_results(); $total_authors = $user_query->get_total(); // Add pagination // Display authors if available do_action( 'adqs_before_main_content' ); $authors = map_deep( $authors, 'absint' ); // Get style type $style_type = $args['style_type'] ?? ''; ?>
" id="adqs-agent-all" data-ad-fragment='adqs-agent-all' >

:

Helper->get_setting( 'enable_review' ); $base_sort_options = [ 'name_a_z' => esc_html__( 'Name (A-Z)', 'adirectory' ), 'name_z_a' => esc_html__( 'Name (Z-A)', 'adirectory' ), 'listing_count' => esc_html__( 'Listing Count', 'adirectory' ), ]; // Add rating options only if review system is enabled if ( ! empty( $enable_review ) ) { $base_sort_options['rating'] = esc_html__( 'Ratings', 'adirectory' ); $base_sort_options['review_count'] = esc_html__( 'Review Count', 'adirectory' ); } $allSortBy = apply_filters( 'adqs_agents_sort_by', $base_sort_options ); if ( ! empty( $allSortBy ) ) : ?>
Helper; $review_ratings = $Helper->get_author_ratings( $author_id ); $review_count = $Helper->get_author_review_count( $author_id ); ?>
'fa-facebook', 'adqs_twitter_profile' => 'fa-twitter', 'adqs_instagram_profile' => 'fa-instagram', 'adqs_linked_profile' => 'fa-linkedin', ]; $author_socials = array_filter( $author_socials, function ( $key ) use ( $author_id ) { return get_user_meta( $author_id, $key, true ) ? true : false; }, ARRAY_FILTER_USE_KEY ); if ( ! empty( $author_socials ) ) : ?>
1 ) : // Get pagination items with dots $shortcode_instance = new \ADQS_Directory\Frontend\Shortcode(); $pagination_items = $shortcode_instance->generate_pagination_with_dots( $current_page, $total_pages, $page_url ?? '', $ajax_filter ); ?>
    1 ) : ?>