1/* 2 * Function that adds placeholders to Login Forms and Widget fields 3 * 4 * @since v.2.1 5 * 6 */ 7jQuery( document ).ready( function() { 8 9 // add placeholder to Login Form Fields 10 loginFieldPlaceholder(); 11 12 // add placeholder to the 2FA Field 13 loginAuthPlaceholder(); 14 15}); 16 17/** 18 * Add Placeholder for Login Form Fields 19 * 20 */ 21function loginFieldPlaceholder () { 22 jQuery(".login-username input, .login-password input").each( function ( index, elem ) { 23 var element_id = jQuery( elem ).attr( 'id' ); 24 if( element_id && ( label = jQuery( elem ).parents( '#wppb-login-wrap' ).find( 'label[for=' + element_id + ']' ) ).length === 1 ) { 25 jQuery( elem ).attr( 'placeholder', jQuery( label ).text() ); 26 } 27 }); 28} 29 30/** 31 * Add Placeholder for 2FA Field on Login Form 32 * 33 */ 34function loginAuthPlaceholder () { 35 let element = jQuery( ".login-auth input" ), 36 element_id = element.attr( 'id' ), 37 label = jQuery( 'label[for=' + element_id + ']' ); 38 39 if( element_id && label.length === 1 ) { 40 jQuery( '#' + element_id ).attr( 'placeholder', label.text() ); 41 } 42}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.