WordPress.org

Making WordPress.org

Changeset 9767


Ignore:
Timestamp:
04/23/2020 02:46:07 AM (20 months ago)
Author:
dd32
Message:

WordPress.TV: Force multiple speakers to be separated by a comma, strip multiple spaces from the field, and add a placeholder example.

Fixes #5166.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php

    r9262 r9767  
    320320                    <p>
    321321                        <label for="wptv_speakers"><?php esc_html_e( 'Speakers' ); ?></label>
    322                         <input type="text" id="wptv_speakers" name="wptv_speakers" value="<?php echo esc_attr( wp_unslash( $_GET['wptv_speakers'] ?? '' ) ); ?>" />
     322                        <input type="text" id="wptv_speakers" name="wptv_speakers" placeholder="John Smith, Jane Doe" value="<?php echo esc_attr( wp_unslash( $_GET['wptv_speakers'] ?? '' ) ); ?>" />
    323323                    </p>
    324324                    <p>
     
    399399            });
    400400
     401            // Make the Speakers field "Name, Name, Name" and not allow "Name and Name".
     402            $( '#wptv_speakers' ).on( 'change', function() {
     403                var $this = $(this);
     404                $this.val( $this.val().replace( /\s(and|&|\+)\s/g, ', ' ).replace( /[ ]{2,}/g, ' ' ) );
     405            });
     406
    401407            $( '#video-upload-form' ).submit( function( e ) {
    402408                var scroll = false;
Note: See TracChangeset for help on using the changeset viewer.