Making WordPress.org


Ignore:
Timestamp:
06/23/2022 05:40:03 PM (4 years ago)
Author:
iandunn
Message:

Profiles: Add handler for WordCamp mentor activity.

See https://github.com/WordPress/five-for-the-future/issues/193

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php

    r11841 r11923  
    597597                                        );
    598598                                }
     599
    599600                        } elseif ( isset( $_POST['organizer_id'] ) && ! empty( $_POST['organizer_id'] ) ) {
    600601                                $type    = 'wordcamp_organizer_add';
     
    614615                                        );
    615616                                }
     617
     618                        } elseif ( isset( $_POST['type'] ) && 'mentor_assign' === $_POST['type'] ) {
     619                                $type          = 'wordcamp_mentor_assign';
     620                                $item_id       = absint( $_POST['wordcamp_id'] );
     621                                $wordcamp_name = sanitize_text_field( $_POST['wordcamp_name'] );
     622
     623                                if ( empty( $_POST['url'] ) ) {
     624                                        $action = 'Started mentoring ' . $wordcamp_name;
     625                                } else {
     626                                        $action = sprintf(
     627                                                'Started mentoring <a href="%s">%s</a>',
     628                                                sanitize_url( $_POST['url'] ),
     629                                                $wordcamp_name
     630                                        );
     631                                }
     632
    616633                        } elseif ( isset( $_POST['attendee_id'] ) && ! empty( $_POST['attendee_id'] ) ) {
    617634                                $item_id = $_POST['attendee_id'];
     
    633650                                                );
    634651                                        }
     652
    635653                                } elseif ( 'attendee_checked_in' == $_POST['activity_type'] ) {
    636654                                        $type  = 'wordcamp_attendee_checked_in';
     
    654672                                'action'            => $action,
    655673                                'content'           => '',
    656                                 'primary_link'      => $_POST['url'],
     674                                'primary_link'      => $_POST['url'] ?? '',
    657675                                'component'         => 'wordcamp',
    658676                                'type'              => $type,
Note: See TracChangeset for help on using the changeset viewer.