This commit is contained in:
claudiulodro 2017-09-22 14:14:00 -07:00
parent b3f70bb7b5
commit 877a8491ad
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,9 @@ jQuery( function( $ ) {
if ( thislocale[ key ].placeholder ) {
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].placeholder );
// Use the i18n label as a placeholder if there is no label element or i18n placeholder.
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].placeholder );
// Use the i18n label as a placeholder if there is no label element and no i18n placeholder.
} else if ( thislocale[ key ].label && ! field.find( 'label' ).length ) {
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].label );
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].label );