@@ -11,29 +11,29 @@ |
||
11 | 11 | <div id="ee-block-event-attendees" class="ee-core-blocks event-espresso-blocks event-attendees"> |
12 | 12 | <ul> |
13 | 13 | <?php |
14 | - foreach ($attendees as $attendee) { |
|
15 | - $gravatar = $attributes['showGravatar'] |
|
16 | - ? get_avatar_url( |
|
17 | - $attendee->email(), |
|
18 | - array( |
|
19 | - 'width' => $attributes['avatarSize'], |
|
20 | - 'height' => $attributes['avatarSize'] |
|
21 | - ) |
|
22 | - ) |
|
23 | - : ''; |
|
24 | - $gravatar_class = $attributes['avatarClass'] |
|
25 | - ? $attributes['avatarClass'] . ' contact-avatar-img avatar' |
|
26 | - : 'contact-avatar-img avatar'; |
|
27 | - $gravatar = $gravatar !== '' |
|
28 | - ? '<div class="contact-image-wrap-div">' |
|
29 | - . '<img class="' . $gravatar_class . '"' |
|
30 | - . ' width="' . $attributes['avatarSize'] . '"' |
|
31 | - . ' height="' . $attributes['avatarSize'] . '"' |
|
32 | - . ' src="' . $gravatar . '" alt="contact avatar">' |
|
33 | - . '</div>' |
|
34 | - : ''; |
|
35 | - echo "<li>{$gravatar}<span>{$attendee->full_name()}</span>"; |
|
36 | - } |
|
37 | - ?> |
|
14 | + foreach ($attendees as $attendee) { |
|
15 | + $gravatar = $attributes['showGravatar'] |
|
16 | + ? get_avatar_url( |
|
17 | + $attendee->email(), |
|
18 | + array( |
|
19 | + 'width' => $attributes['avatarSize'], |
|
20 | + 'height' => $attributes['avatarSize'] |
|
21 | + ) |
|
22 | + ) |
|
23 | + : ''; |
|
24 | + $gravatar_class = $attributes['avatarClass'] |
|
25 | + ? $attributes['avatarClass'] . ' contact-avatar-img avatar' |
|
26 | + : 'contact-avatar-img avatar'; |
|
27 | + $gravatar = $gravatar !== '' |
|
28 | + ? '<div class="contact-image-wrap-div">' |
|
29 | + . '<img class="' . $gravatar_class . '"' |
|
30 | + . ' width="' . $attributes['avatarSize'] . '"' |
|
31 | + . ' height="' . $attributes['avatarSize'] . '"' |
|
32 | + . ' src="' . $gravatar . '" alt="contact avatar">' |
|
33 | + . '</div>' |
|
34 | + : ''; |
|
35 | + echo "<li>{$gravatar}<span>{$attendee->full_name()}</span>"; |
|
36 | + } |
|
37 | + ?> |
|
38 | 38 | </ul> |
39 | 39 | </div> |
@@ -17,43 +17,43 @@ |
||
17 | 17 | class Attendee extends AttendeeCalculationsBase |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @param array $wpdb_row |
|
22 | - * @param WP_REST_Request $request |
|
23 | - * @param AttendeeControllerBase $controller |
|
24 | - * @since 4.9.66.p |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public function userAvatar(array $wpdb_row, WP_REST_Request $request, AttendeeControllerBase $controller) |
|
28 | - { |
|
29 | - if (is_array($wpdb_row) && isset($wpdb_row['Attendee_Meta.ATT_email'])) { |
|
30 | - $email_address = $wpdb_row['Attendee_Meta.ATT_email']; |
|
31 | - } |
|
32 | - if (empty($email_address)) { |
|
33 | - return get_avatar_url('', array('force_default' => true)); |
|
34 | - } |
|
35 | - $avatar = get_avatar_url($email_address); |
|
36 | - return $avatar ? $avatar : ''; |
|
37 | - } |
|
20 | + /** |
|
21 | + * @param array $wpdb_row |
|
22 | + * @param WP_REST_Request $request |
|
23 | + * @param AttendeeControllerBase $controller |
|
24 | + * @since 4.9.66.p |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public function userAvatar(array $wpdb_row, WP_REST_Request $request, AttendeeControllerBase $controller) |
|
28 | + { |
|
29 | + if (is_array($wpdb_row) && isset($wpdb_row['Attendee_Meta.ATT_email'])) { |
|
30 | + $email_address = $wpdb_row['Attendee_Meta.ATT_email']; |
|
31 | + } |
|
32 | + if (empty($email_address)) { |
|
33 | + return get_avatar_url('', array('force_default' => true)); |
|
34 | + } |
|
35 | + $avatar = get_avatar_url($email_address); |
|
36 | + return $avatar ? $avatar : ''; |
|
37 | + } |
|
38 | 38 | |
39 | 39 | |
40 | - /** |
|
41 | - * Provides an array for all the calculations possible that outlines a json schema for those calculations. |
|
42 | - * Array is indexed by calculation (snake case) and value is the schema for that calculation. |
|
43 | - * |
|
44 | - * @since 4.9.68.p |
|
45 | - * @return array |
|
46 | - */ |
|
47 | - public function schemaForCalculations() |
|
48 | - { |
|
49 | - return array( |
|
50 | - 'user_avatar' => array( |
|
51 | - 'description' => esc_html__( |
|
52 | - 'The avatar url for the attendee (if available).', |
|
53 | - 'event_espresso' |
|
54 | - ), |
|
55 | - 'type' => 'string', |
|
56 | - ), |
|
57 | - ); |
|
58 | - } |
|
40 | + /** |
|
41 | + * Provides an array for all the calculations possible that outlines a json schema for those calculations. |
|
42 | + * Array is indexed by calculation (snake case) and value is the schema for that calculation. |
|
43 | + * |
|
44 | + * @since 4.9.68.p |
|
45 | + * @return array |
|
46 | + */ |
|
47 | + public function schemaForCalculations() |
|
48 | + { |
|
49 | + return array( |
|
50 | + 'user_avatar' => array( |
|
51 | + 'description' => esc_html__( |
|
52 | + 'The avatar url for the attendee (if available).', |
|
53 | + 'event_espresso' |
|
54 | + ), |
|
55 | + 'type' => 'string', |
|
56 | + ), |
|
57 | + ); |
|
58 | + } |
|
59 | 59 | } |