Changeset 8085 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php
- Timestamp:
- 01/16/2019 03:36:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php
r8083 r8085 53 53 54 54 /** 55 * Render the output the of the [meetup-organizer-application]shortcode.55 * Render the output the of the application forms shortcode. 56 56 * 57 57 * @todo Use force_login_to_view_form() and populate_form_based_on_user(). … … 62 62 ob_start(); 63 63 64 // phpcs:ignore WordPress.Security.NonceVerification.Missing -- We do not verify nonce for frontend forms because WP Super Cache may cache an expired nonce token. 64 65 if ( isset( $_POST['submit-application'] ) ) { 65 $this->submit_application( );66 $this->submit_application( $_POST ); 66 67 } else { 67 68 $countries = wcorg_get_countries(); … … 83 84 /** 84 85 * Submit application details. Calls `create_post` to actually create the event. 85 */ 86 public function submit_application() { 87 $application_data = $this->validate_data( $_POST ); 86 * 87 * @param array $post_data Form params. 88 */ 89 public function submit_application( $post_data ) { 90 $application_data = $this->validate_data( $post_data ); 88 91 89 92 if ( $this->is_rate_limited() ) { … … 96 99 $this->create_post( $application_data ); 97 100 $this->notify_applicant_application_received( 98 99 101 $this->get_organizer_email(), 102 $this->get_event_location() 100 103 ); 101 104 … … 223 226 $message = sprintf( 224 227 __( 225 "Thank you for applying to organize a % s in %s! We'll send you a follow-up e-mail once we've had a chance to review your application.",228 "Thank you for applying to organize a %1\$s in %2\$s! We'll send you a follow-up e-mail once we've had a chance to review your application.", 226 229 'wpct' 227 230 ), 228 $this->get_event_label(), sanitize_text_field( $event_city ) 231 $this->get_event_label(), 232 sanitize_text_field( $event_city ) 229 233 ); 230 234 … … 238 242 239 243 // Not translating because this will be sent to community events slack channel. 240 $message = sprintf( "A %s application for %s has been received.", $this->get_event_label(), $this->get_event_location() );244 $message = sprintf( 'A %s application for %s has been received.', $this->get_event_label(), $this->get_event_location() ); 241 245 242 246 $public_report_url = $this->get_application_report_url(); 243 247 if ( isset( $public_report_url ) ) { 244 248 // `<%s|here> is syntax for slack message to hyperlink text `here` with url provided in `%s` 245 $message = sprintf( "%s Public status can be followed on <%s|%s application report page>.", $message, $public_report_url, $this->get_event_label() );249 $message = sprintf( '%s Public status can be followed on <%s|%s application report page>.', $message, $public_report_url, $this->get_event_label() ); 246 250 } 247 251 248 252 $default_status = $this->get_default_status(); 249 $queue_size = wp_count_posts( $ post_type=$this->get_event_type() )->$default_status;253 $queue_size = wp_count_posts( $this->get_event_type() )->$default_status; 250 254 if ( isset( $queue_size ) ) { 251 255 $singular = "is $queue_size application"; 252 256 $plural = "are $queue_size applications"; 253 257 $message = sprintf( 254 "%s\n _There %s in vetting queue._", 255 $message, 256 1 === $queue_size ? $singular : $plural ); 257 } 258 259 $attachment = create_event_attachment( $message, sprintf( "New %s application ", $this->get_event_label() ) ); 258 "%s\n _There %s in vetting queue._", 259 $message, 260 1 === $queue_size ? $singular : $plural 261 ); 262 } 263 264 $attachment = create_event_attachment( $message, sprintf( 'New %s application ', $this->get_event_label() ) ); 260 265 return wcpt_slack_notify( COMMUNITY_TEAM_SLACK, $attachment ); 261 266 }
Note: See TracChangeset
for help on using the changeset viewer.