Skip to content

Commit

Permalink
default to empty string when index doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Oct 9, 2023
1 parent 10e9049 commit cfc9d55
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function form_prefill_select( $data ) {
<span class="description"><?php esc_html_e( 'Sponsorship details will be pre-filled with the data on sponsor post.', 'wordcamporg' ); ?></span>

<label><?php esc_html_e( 'Sponsorship Benefits:', 'wordcamporg' ); ?></label>
<textarea name="sponsorship_benefits"><?php echo esc_textarea( $data['sponsorship_benefits'] ); ?></textarea>
<textarea name="sponsorship_benefits"><?php echo esc_textarea( $data['sponsorship_benefits'] ?? '' ); ?></textarea>
<span class="description"><?php esc_html_e( 'Use multiple lines.', 'wordcamporg' ); ?></span>
</div>

Expand Down Expand Up @@ -336,7 +336,7 @@ public function sanitize( $input ) {
'sponsorship_amount',
'sponsorship_amount_num',
) as $field )
$output[ $field ] = sanitize_text_field( wp_strip_all_tags( $input[ $field ] ) );
$output[ $field ] = sanitize_text_field( wp_strip_all_tags( $input[ $field ] ?? '' ) );

$output['sponsorship_benefits'] = wp_strip_all_tags( $input['sponsorship_benefits'] );
return $output;
Expand Down

0 comments on commit cfc9d55

Please sign in to comment.