diff --git a/public_html/wp-content/plugins/wordcamp-docs/templates/sponsorship-agreement.php b/public_html/wp-content/plugins/wordcamp-docs/templates/sponsorship-agreement.php index 5e65e7702..6c08ba556 100644 --- a/public_html/wp-content/plugins/wordcamp-docs/templates/sponsorship-agreement.php +++ b/public_html/wp-content/plugins/wordcamp-docs/templates/sponsorship-agreement.php @@ -53,30 +53,30 @@ public function form_prefill_select( $data ) { public function form( $data ) { $date_format = get_option( 'date_format' ); - $sponsor_id = absint( $data['sponsor_id'] ); - $sponsor_amount = get_post_meta( $sponsor_id, '_wcb_sponsor_amount', true ); - $sponsor_currency = get_post_meta( $sponsor_id, '_wcb_sponsor_currency', true ); + $sponsor_id = absint( $data['sponsor_id'] ); + $sponsor_amount = get_post_meta( $sponsor_id, '_wcb_sponsor_amount', true ); + $sponsor_currency = get_post_meta( $sponsor_id, '_wcb_sponsor_currency', true ); - $wordcamp = get_wordcamp_post(); - $start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( $date_format, $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : ''; - $end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( $date_format, $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date; + $wordcamp = get_wordcamp_post(); + $start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( $date_format, $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : ''; + $end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( $date_format, $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date; - $number_formatter = new NumberFormatter( get_locale(), NumberFormatter::SPELLOUT ); + $number_formatter = new NumberFormatter( get_locale(), NumberFormatter::SPELLOUT ); $sponsorship_amount = $number_formatter->format( $sponsor_amount ) . " {$sponsor_currency}"; - $number_formatter = new NumberFormatter( get_locale(), NumberFormatter::CURRENCY ); + $number_formatter = new NumberFormatter( get_locale(), NumberFormatter::CURRENCY ); $sponsorship_amount_num = $number_formatter->formatCurrency( $sponsor_amount, $sponsor_currency ); $data = wp_parse_args( $data, array( - 'sponsor_name' => get_the_title( $sponsor_id ), - 'sponsor_rep_name' => get_post_meta( $sponsor_id, '_wcpt_sponsor_first_name', true ) . ' ' . get_post_meta( $sponsor_id, '_wcpt_sponsor_last_name', true ), - 'sponsor_rep_title' => '', - 'agreement_date' => wp_date( $date_format ), - 'wordcamp_location' => $wordcamp->meta['Location'][0], - 'wordcamp_date' => ( $start_date !== $end_date ) ? "{$start_date} - {$end_date}" : $start_date, - 'sponsorship_amount' => $sponsorship_amount, - 'sponsorship_amount_num' => $sponsorship_amount_num, - 'sponsorship_benefits' => '', + 'sponsor_name' => get_the_title( $sponsor_id ), + 'sponsor_rep_name' => get_post_meta( $sponsor_id, '_wcpt_sponsor_first_name', true ) . ' ' . get_post_meta( $sponsor_id, '_wcpt_sponsor_last_name', true ), + 'sponsor_rep_title' => '', + 'agreement_date' => wp_date( $date_format ), + 'wordcamp_location' => $wordcamp->meta['Location'][0], + 'wordcamp_date' => ( $start_date !== $end_date ) ? "{$start_date} - {$end_date}" : $start_date, + 'sponsorship_amount' => $sponsorship_amount, + 'sponsorship_amount_num' => $sponsorship_amount_num, + 'sponsorship_benefits' => '', ) ); ?>