Making WordPress.org


Ignore:
Timestamp:
10/25/2017 02:04:21 PM (7 years ago)
Author:
iandunn
Message:

WordCamp Docs: Pre-populate Speaker and Attendee visas.

Fixes #3199
Props casiepa, grapplerulrich

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php

    r6053 r6054  
    55class WordCamp_Docs_Template_Speaker_Visa implements WordCamp_Docs_Template {
    66    public function form( $data ) {
     7        $wordcamp    = get_wordcamp_post();
     8        $start_date  = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : '';
     9        $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;
     10
    711        $data = wp_parse_args( $data, array(
    812            'speaker_first_name'   => '',
     
    1115            'passport_number' => '',
    1216
    13             'wordcamp_name' => '',
    14             'wordcamp_location' => '',
    15             'wordcamp_date_start' => '',
    16             'wordcamp_date_end' => '',
    17 
    18             'organizer_name' => '',
     17            'wordcamp_name'       => $wordcamp->post_title          ?? '',
     18            'wordcamp_location'   => $wordcamp->meta['Location'][0] ?? '',
     19            'wordcamp_date_start' => $start_date,
     20            'wordcamp_date_end'   => $end_date,
     21
     22            'organizer_name'     => $wordcamp->meta['Organizer Name'][0] ?? '',
    1923            'organizer_contacts' => '',
    2024        ) );
Note: See TracChangeset for help on using the changeset viewer.