Changeset 8374 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php
- Timestamp:
- 02/28/2019 03:34:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php
r8262 r8374 259 259 * @return string 260 260 */ 261 public function set_locale_to_en_ US() {261 public function set_locale_to_en_us() { 262 262 return 'en_US'; 263 263 } … … 280 280 281 281 // Ensure status labels are in English. 282 add_filter( 'locale', array( $this, 'set_locale_to_en_ US' ) );282 add_filter( 'locale', array( $this, 'set_locale_to_en_us' ) ); 283 283 284 284 $old_status = get_post_status_object( $old_status ); … … 302 302 303 303 // Remove the temporary locale change. 304 remove_filter( 'locale', array( $this, 'set_locale_to_en_ US' ) );304 remove_filter( 'locale', array( $this, 'set_locale_to_en_us' ) ); 305 305 } 306 306 … … 315 315 316 316 /** 317 * Schedule notifica iton for declined application. Currently supports WordCamp and Meetup317 * Schedule notification for declined application. Currently supports WordCamp and Meetup. 318 318 * 319 319 * @param WP_Post $event Event object. … … 331 331 * @param string $label 332 332 * @param string $location 333 * 334 * @return null|bool|string 333 335 */ 334 336 public static function send_decline_notification( $event_id, $label, $location ) { 337 $declined_notification_key = 'sent_declined_notification'; 338 if ( get_post_meta( $event_id, $declined_notification_key, true ) ) { 339 return null; 340 } 341 335 342 $message = sprintf( 336 343 'A %s application for %s has been declined, and the applicant has been informed via email.', … … 340 347 341 348 $attachment = create_event_status_attachment( $message, $event_id, '' ); 342 wcpt_slack_notify( COMMUNITY_TEAM_SLACK, $attachment ); 349 350 $notification_sent = wcpt_slack_notify( COMMUNITY_TEAM_SLACK, $attachment ); 351 if ( $notification_sent ) { 352 update_post_meta( $event_id, $declined_notification_key, true ); 353 } 354 return $notification_sent; 343 355 } 344 356 … … 443 455 444 456 // Don't add/remove meta on trash, untrash, restore, etc. 457 // phpcs:ignore WordPress.Security.NonceVerification.Missing 445 458 if ( empty( $_POST['action'] ) || 'editpost' !== $_POST['action'] ) { 446 459 return; … … 453 466 } 454 467 } 455 456 468 457 469 $meta_keys = $this->meta_keys();
Note: See TracChangeset
for help on using the changeset viewer.