WordPress.org

Making WordPress.org

Ticket #3199: 3199.diff

File 3199.diff, 5.8 KB (added by casiepa, 2 years ago)
  • wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php
    index 172ee7c5..05734b48 100644
     
    44 */
    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                $wc_location = !empty( $wordcamp->meta['Location'][0] ) ? $wordcamp->meta['Location'][0] : '';
     11                $org_name = !empty( $wordcamp->meta['Organizer Name'][0] ) ? $wordcamp->meta['Organizer Name'][0] : '';
     12               
    713                $data = wp_parse_args( $data, array(
    814                        'attendee_first_name' => '',
    915                        'attendee_last_name' => '',
    1016                        'country_of_residency' => '',
    1117                        'passport_number' => '',
    1218
    13                         'wordcamp_name' => '',
    14                         'wordcamp_location' => '',
    15                         'wordcamp_date_start' => '',
    16                         'wordcamp_date_end' => '',
     19                        'wordcamp_name' => $wordcamp->post_title,
     20                        'wordcamp_location' => $wc_location,
     21                        'wordcamp_date_start' => $start_date,
     22                        'wordcamp_date_end' => $end_date,
    1723
    18                         'organizer_name' => '',
     24                        'organizer_name' => $org_name,
    1925                        'organizer_contacts' => '',
    2026                ) );
    2127                ?>
  • wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php
    index a8a77dea..1eb4d4e3 100644
     
    44 */
    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                $wc_location = !empty( $wordcamp->meta['Location'][0] ) ? $wordcamp->meta['Location'][0] : '';
     11                $org_name = !empty( $wordcamp->meta['Organizer Name'][0] ) ? $wordcamp->meta['Organizer Name'][0] : '';
     12
    713                $data = wp_parse_args( $data, array(
    8                         'attendee_first_name' => '',
    9                         'attendee_last_name' => '',
     14                        'speaker_first_name' => '',
     15                        'speaker_last_name' => '',
    1016                        'country_of_residency' => '',
    1117                        'passport_number' => '',
    1218
    13                         'wordcamp_name' => '',
    14                         'wordcamp_location' => '',
    15                         'wordcamp_date_start' => '',
    16                         'wordcamp_date_end' => '',
     19                        'wordcamp_name' => $wordcamp->post_title,
     20                        'wordcamp_location' => $wc_location,
     21                        'wordcamp_date_start' => $start_date,
     22                        'wordcamp_date_end' => $end_date,
    1723
    18                         'organizer_name' => '',
     24                        'organizer_name' => $org_name,
    1925                        'organizer_contacts' => '',
    2026                ) );
    2127                ?>
    class WordCamp_Docs_Template_Speaker_Visa implements WordCamp_Docs_Template { 
    4450
    4551                <div class="wcorg-docs-form">
    4652                        <label><?php _e( 'Speaker First Name:', 'wordcamporg' ); ?></label>
    47                         <input name="attendee_first_name" value="<?php echo esc_attr( $data['attendee_first_name'] ); ?>" />
     53                        <input name="attendee_first_name" value="<?php echo esc_attr( $data['speaker_first_name'] ); ?>" />
    4854
    4955                        <label><?php _e( 'Speaker Last Name:', 'wordcamporg' ); ?></label>
    50                         <input name="attendee_last_name" value="<?php echo esc_attr( $data['attendee_last_name'] ); ?>" />
     56                        <input name="attendee_last_name" value="<?php echo esc_attr( $data['speaker_last_name'] ); ?>" />
    5157
    5258                        <label><?php _e( 'Country of Residency:', 'wordcamporg' ); ?></label>
    5359                        <input name="country_of_residency" value="<?php echo esc_attr( $data['country_of_residency'] ); ?>" />
    h2 { 
    163169
    164170                <p>To Whom It May Concern:</p>
    165171
    166                 <p>This letter is to confirm that <?php echo esc_html( $data['attendee_first_name'] ); ?> <?php echo esc_html( $data['attendee_last_name'] ); ?>
     172                <p>This letter is to confirm that <?php echo esc_html( $data['speaker_first_name'] ); ?> <?php echo esc_html( $data['speaker_last_name'] ); ?>
    167173                <?php echo esc_html( $data['country_of_residency'] ); ?> passport number <?php echo esc_html( $data['passport_number'] ); ?>,
    168174                has been invited to speak at <?php echo esc_html( $data['wordcamp_name'] ); ?>, a community-organized event focusing on WordPress
    169175                development and technology.</p>
    h2 { 
    171177                <p>WordPress is a web software you can use to create a beautiful website or blog. The core software is built by hundreds of community
    172178                volunteers. The mission of the WordPress open source project is to democratize publishing through Open Source, GPL software.</p>
    173179
    174                 <p>To fulfill speaking duties at <?php echo esc_html( $data['wordcamp_name'] ); ?>, <?php echo esc_html( $data['attendee_first_name'] ); ?>
     180                <p>To fulfill speaking duties at <?php echo esc_html( $data['wordcamp_name'] ); ?>, <?php echo esc_html( $data['speaker_first_name'] ); ?>
    175181                will need to be in <?php echo esc_html( $data['wordcamp_location'] ); ?> from <?php echo esc_html( $data['wordcamp_date_start'] ); ?>
    176182                through <?php echo esc_html( $data['wordcamp_date_end'] ); ?>.
    177183
    h2 { 
    196202        public function sanitize( $input ) {
    197203                $output = array();
    198204                foreach ( array(
    199                         'attendee_first_name',
    200                         'attendee_last_name',
     205                        'speaker_first_name',
     206                        'speaker_last_name',
    201207                        'country_of_residency',
    202208                        'passport_number',
    203209                        'wordcamp_name',