Skip to content

Commit

Permalink
WordCamp Docs: Pre-populate Speaker and Attendee visas.
Browse files Browse the repository at this point in the history
Fixes #3199
Props casiepa, grapplerulrich

git-svn-id: http://meta.svn.wordpress.org/sites/trunk/wordcamp.org@6054 74240141-8908-4e6f-9713-ba540dce6ec7
  • Loading branch information
iandunn committed Oct 25, 2017
1 parent a8d07f5 commit b5234c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
*/
class WordCamp_Docs_Template_Attendee_Visa implements WordCamp_Docs_Template {
public function form( $data ) {
$wordcamp = get_wordcamp_post();
$start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : '';
$end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date;

$data = wp_parse_args( $data, array(
'attendee_first_name' => '',
'attendee_last_name' => '',
'country_of_residency' => '',
'passport_number' => '',

'wordcamp_name' => '',
'wordcamp_location' => '',
'wordcamp_date_start' => '',
'wordcamp_date_end' => '',
'wordcamp_name' => $wordcamp->post_title ?? '',
'wordcamp_location' => $wordcamp->meta['Location'][0] ?? '',
'wordcamp_date_start' => $start_date,
'wordcamp_date_end' => $end_date,

'organizer_name' => '',
'organizer_name' => $wordcamp->meta['Organizer Name'][0] ?? '',
'organizer_contacts' => '',
) );
?>
Expand All @@ -42,6 +46,10 @@ public function form( $data ) {
}
</style>

<h2>
<?php _e( 'Attendee Visa Letter', 'wordcamporg' ); ?>
</h2>

<div class="wcorg-docs-form">
<label><?php _e( 'Attendee First Name:', 'wordcamporg' ); ?></label>
<input name="attendee_first_name" value="<?php echo esc_attr( $data['attendee_first_name'] ); ?>" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
*/
class WordCamp_Docs_Template_Speaker_Visa implements WordCamp_Docs_Template {
public function form( $data ) {
$wordcamp = get_wordcamp_post();
$start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : '';
$end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date;

$data = wp_parse_args( $data, array(
'speaker_first_name' => '',
'speaker_last_name' => '',
'country_of_residency' => '',
'passport_number' => '',

'wordcamp_name' => '',
'wordcamp_location' => '',
'wordcamp_date_start' => '',
'wordcamp_date_end' => '',
'wordcamp_name' => $wordcamp->post_title ?? '',
'wordcamp_location' => $wordcamp->meta['Location'][0] ?? '',
'wordcamp_date_start' => $start_date,
'wordcamp_date_end' => $end_date,

'organizer_name' => '',
'organizer_name' => $wordcamp->meta['Organizer Name'][0] ?? '',
'organizer_contacts' => '',
) );
?>
Expand Down

0 comments on commit b5234c3

Please sign in to comment.