Making WordPress.org

Changeset 8084


Ignore:
Timestamp:
01/15/2019 11:02:54 AM (5 years ago)
Author:
vedjain
Message:

WCPT: Do not send notifications when Old and New status are same

We would have already notified when Meetup or WordCamp application would have been accepted for first time. So no need to do it again.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/notification.php

    r8083 r8084  
    110110 */
    111111function get_user_nicenames_from_ids( $user_ids ) {
     112    if ( empty( $user_ids ) ) {
     113        return array();
     114    }
     115
    112116    $user_query = new WP_User_Query( array( 'include' => $user_ids, 'fields'  => array( 'user_nicename' ), ) );
    113117
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-admin.php

    r8083 r8084  
    498498            }
    499499
    500             if ( 'wcpt-mtp-active' === $new_status ) {
     500            if ( 'wcpt-mtp-active' === $new_status && 'wcpt-mtp-active' !== $old_status ) {
    501501                return $this->notify_new_meetup_group_in_slack( $meetup );
    502             } elseif ( 'wcpt-mtp-rejected' === $new_status ) {
     502            } elseif ( 'wcpt-mtp-rejected' === $new_status && 'wcpt-mtp-rejected' !== $old_status ) {
    503503                $location = get_post_meta( $meetup->ID, 'Meetup Location', true );
    504504                return $this->schedule_decline_notification( $meetup, $this->get_event_label(), $location );
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r8083 r8084  
    725725            }
    726726
    727             if ( 'wcpt-scheduled' === $new_status ) {
     727            if ( 'wcpt-scheduled' === $new_status && 'wcpt-scheduled' !== $old_status ) {
    728728                return $this->notify_new_wordcamp_in_slack( $wordcamp );
    729             } elseif ( 'wcpt-rejected' === $new_status ) {
     729            } elseif ( 'wcpt-rejected' === $new_status && 'wcpt-rejected' !== $old_status ) {
    730730                $location = get_post_meta( $wordcamp->ID, 'Location', true );
    731731                return $this->schedule_decline_notification( $wordcamp, 'WordCamp', $location );
Note: See TracChangeset for help on using the changeset viewer.