Changeset 7472 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-attendance/addons/attendance.php
- Timestamp:
- 07/17/2018 07:24:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-attendance/addons/attendance.php
r5531 r7472 71 71 72 72 /** 73 * Synchronize a nattendee model.73 * Synchronize a single attendee model. 74 74 * 75 75 * Sets are removes the attended flag for a given camptix_id. … … 114 114 115 115 $query_args = array( 116 'post_type' => 'tix_attendee',117 'post_status' => 'publish',118 'orderby' => 'title',119 'order' => 'ASC',120 'paged' => $paged,116 'post_type' => 'tix_attendee', 117 'post_status' => 'publish', 118 'orderby' => 'title', 119 'order' => 'ASC', 120 'paged' => $paged, 121 121 'posts_per_page' => 50, 122 'meta_query' => '',122 'meta_query' => '', 123 123 ); 124 125 /** 126 * Sort Attendee Posts 127 */ 128 if ( ! empty( $_REQUEST['camptix_filters']['sort'] ) ) { 129 switch ( $_REQUEST['camptix_filters']['sort'] ) { 130 case 'lastName': 131 $query_args['orderby'] = 'meta_value'; 132 $query_args['meta_key'] = 'tix_last_name'; 133 break; 134 case 'orderDate': 135 $query_args['orderby'] = 'date'; 136 $query_args['order'] = 'DESC'; 137 break; 138 case 'firstName': 139 default: 140 // each $attendee->post_title is already First Lastname 141 break; 142 } 143 144 unset( $_REQUEST['camptix_filters']['sort'] ); 145 } 124 146 125 147 $filters = array(); … … 174 196 175 197 $first_name = get_post_meta( $attendee->ID, 'tix_first_name', true ); 176 $last_name = get_post_meta( $attendee->ID, 'tix_last_name', true );198 $last_name = get_post_meta( $attendee->ID, 'tix_last_name', true ); 177 199 $avatar_url = sprintf( 'https://secure.gravatar.com/avatar/%s?s=160', md5( get_post_meta( $attendee->ID, 'tix_email', true ) ) ); 178 200 $avatar_url = add_query_arg( 'd', 'https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=160', $avatar_url ); … … 182 204 return array( 183 205 'id' => $attendee->ID, 184 'name' => sprintf( '%s %s', $first_name, $last_name ), 206 'firstName' => $first_name, 207 'lastName' => $last_name, 185 208 'avatar' => esc_url_raw( $avatar_url ), 186 209 'status' => $status, … … 250 273 public function setup_sections( $sections ) { 251 274 $sections['attendance-ui'] = esc_html__( 'Attendance UI', 'wordcamporg' ); 275 252 276 return $sections; 253 277 } … … 314 338 315 339 /** 316 * Get CampTix Tickets 340 * Get CampTix Tickets (not to be confused with Attendees) 317 341 * 318 342 * Returns an array of published tickets registered with CampTix.
Note: See TracChangeset
for help on using the changeset viewer.