Skip to content

Commit d9eb89a

Browse files
committed
Missing spaces caused registration info field to break.
Also simplifies variable assignment & moves escaping later.
1 parent c4cb50a commit d9eb89a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/my-calendar-event-editor.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,20 +3022,15 @@ function mc_standard_event_registration( $form, $has_data, $data, $context = 'ad
30223022
if ( 'public' === $context ) {
30233023
return '';
30243024
}
3025-
if ( $has_data ) {
3026-
$tickets = $data->event_tickets;
3027-
$registration = stripslashes( esc_attr( $data->event_registration ) );
3028-
} else {
3029-
$tickets = '';
3030-
$registration = '';
3031-
}
3025+
$tickets = ( $has_data ) ? $data->event_tickets : '';
3026+
$registration = ( $has_data ) ? $data->event_registration : '';
30323027

30333028
$form .= "<p>
30343029
<label for='event_tickets'>" . __( 'Tickets URL', 'my-calendar' ) . "</label> <input type='url' name='event_tickets' id='event_tickets' value='" . esc_attr( $tickets ) . "' />
30353030
</p>
30363031
<p>
3037-
<label for='event_registration'>" . __( 'Registration Information', 'my-calendar' ) . "</label> <textarea name='event_registration'id='event_registration'cols='40'rows='4'/>$registration</textarea>
3038-
</p>";
3032+
<label for='event_registration'>" . __( 'Registration Information', 'my-calendar' ) . "</label> <textarea name='event_registration' id='event_registration' cols='40' rows='4' />" . esc_textarea( wp_unslash( $registration ) ) . '</textarea>
3033+
</p>';
30393034

30403035
/**
30413036
* Filter event registration form for event input.

0 commit comments

Comments
 (0)