From 3d9fa450f4cf922333561c2127479eeb37b390e0 Mon Sep 17 00:00:00 2001 From: Paul Kevan Date: Mon, 28 Oct 2024 15:26:58 +0000 Subject: [PATCH] only show application url if value appears legitimate --- .../wcpt/wcpt-event/class-event-application.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php b/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php index 6e6f3d53f..7e5288c41 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php @@ -260,7 +260,7 @@ public function display_notice( $message, $notice_classes ) { * @param string $event_city * @param int $application_post id of post created on WC Central. */ - public function notify_applicant_application_received( $email_address, $event_city, $application_post ) { + public function notify_applicant_application_received( $email_address, $event_city, $application_post = 0 ) { //translators: Name of the event. E.g. WordCamp or meetup. $subject = sprintf( __( "We've received your %s application", 'wordcamporg' ), $this->get_event_label() ); $headers = array( @@ -280,13 +280,18 @@ public function notify_applicant_application_received( $email_address, $event_ci $message .= sprintf( "---- Internal details for the Community Team ----\n\n Name: %1\$s\n - Type: %2\$s\n - URL: https://central.wordcamp.org/wp-admin/post.php?post=%3\$d&action=edit", + Type: %2\$s\n", $this->get_event_label(), sanitize_text_field( $event_city ), - absint( $application_post ), ); + if ( 0 !== $application_post ) { + $message .= sprintf( + "URL: https://central.wordcamp.org/wp-admin/post.php?post=%3\$d&action=edit", + absint( $application_post ) + ); + } + wp_mail( $email_address, $subject, $message, $headers ); }