Making WordPress.org


Ignore:
Timestamp:
02/28/2019 03:34:07 PM (7 years ago)
Author:
vedjain
Message:

WCPT: Multiple minor fixes. See description.

  1. Added check while sending declined / scheduled notifications for WordCamp / Meetup, so that we do not send duplicate notifications for same event.
  2. Removed meetup organizer reminder cron because we are not using it anymore. This was already disabled, and this patch just removes dead code from codebase.
  3. Applied code standard and fixes in multiple places.
File:
1 edited

Legend:

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

    r8328 r8374  
    744744         * @param WP_Post $wordcamp
    745745         *
    746          * @return null|bool
     746         * @return null|bool|string
    747747         */
    748748        public static function notify_new_wordcamp_in_slack( $wordcamp ) {
     749            $scheduled_notification_key = 'sent_scheduled_notification';
     750            if ( get_post_meta( $wordcamp->ID, $scheduled_notification_key, true ) ) {
     751                return null;
     752            }
     753
    749754            // Not translating any string because they will be sent to slack.
    750755            $city             = get_post_meta( $wordcamp->ID, 'Location', true );
     
    762767            $attachment = create_event_status_attachment( $message, $wordcamp->ID, $title );
    763768
    764             return wcpt_slack_notify( COMMUNITY_EVENTS_SLACK, $attachment );
     769            $notification_sent = wcpt_slack_notify( COMMUNITY_EVENTS_SLACK, $attachment );
     770            if ( $notification_sent ) {
     771                update_post_meta( $wordcamp->ID, $scheduled_notification_key, true );
     772            }
     773            return $notification_sent;
    765774        }
    766775
Note: See TracChangeset for help on using the changeset viewer.