WordPress.org

Making WordPress.org

Changeset 6054


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

WordCamp Docs: Pre-populate Speaker and Attendee visas.

Fixes #3199
Props casiepa, grapplerulrich

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates
Files:
2 edited

Legend:

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

    r4177 r6054  
    55class WordCamp_Docs_Template_Attendee_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            'attendee_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        ) );
     
    4246        }
    4347        </style>
     48
     49        <h2>
     50            <?php _e( 'Attendee Visa Letter', 'wordcamporg' ); ?>
     51        </h2>
    4452
    4553        <div class="wcorg-docs-form">
  • 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.