Make WordPress Core

Ticket #47318: 47318.diff

File 47318.diff, 1.9 KB (added by masummdar, 6 years ago)

A possible fix to #47318

  • wp-admin/edit-form-advanced.php

    diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
    index b7f6fad..0034606 100644
    a b do_action( 'edit_form_top', $post ); 
    487487        $title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
    488488        ?>
    489489        <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
    490         <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
     490        <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" placeholder="<?php echo $title_placeholder; ?>" spellcheck="true" autocomplete="off" />
    491491</div>
    492492        <?php
    493493        /**
  • wp-admin/js/post.js

    diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js
    index 3168fec..7c66a30 100644
    a b jQuery(document).ready( function($) { 
    10391039                editPermalink();
    10401040        });
    10411041
    1042         /**
    1043          * Adds screen reader text to the title label when needed.
    1044          *
    1045          * Use the 'screen-reader-text' class to emulate a placeholder attribute
    1046          * and hide the label when entering a value.
    1047          *
    1048          * @param {string} id Optional. HTML ID to add the screen reader helper text to.
    1049          *
    1050          * @global
    1051          *
    1052          * @returns void
    1053          */
    1054         window.wptitlehint = function( id ) {
    1055                 id = id || 'title';
    1056 
    1057                 var title = $( '#' + id ), titleprompt = $( '#' + id + '-prompt-text' );
    1058 
    1059                 if ( '' === title.val() ) {
    1060                         titleprompt.removeClass( 'screen-reader-text' );
    1061                 }
    1062 
    1063                 title.on( 'input', function() {
    1064                         if ( '' === this.value ) {
    1065                                 titleprompt.removeClass( 'screen-reader-text' );
    1066                                 return;
    1067                         }
    1068 
    1069                         titleprompt.addClass( 'screen-reader-text' );
    1070                 } );
    1071         };
    1072 
    1073         wptitlehint();
    1074 
    10751042        // Resize the WYSIWYG and plain text editors.
    10761043        ( function() {
    10771044                var editor, offset, mce,