Don't hide the label for the Title on the Edit Post screen, use 'screen-reader-text' instead, props SergeyBiryukov, fixes #21458
git-svn-id: https://develop.svn.wordpress.org/trunk@21584 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a748fa33c4
commit
877e8f6a2a
@ -2827,7 +2827,6 @@ table .inline-edit-row fieldset ul.cat-hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#wp-fullscreen-title-prompt-text {
|
#wp-fullscreen-title-prompt-text {
|
||||||
left: 0;
|
|
||||||
padding: 11px;
|
padding: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
|||||||
<?php if ( post_type_supports($post_type, 'title') ) { ?>
|
<?php if ( post_type_supports($post_type, 'title') ) { ?>
|
||||||
<div id="titlediv">
|
<div id="titlediv">
|
||||||
<div id="titlewrap">
|
<div id="titlewrap">
|
||||||
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
||||||
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
|
@ -641,20 +641,20 @@ jQuery(document).ready( function($) {
|
|||||||
var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');
|
var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');
|
||||||
|
|
||||||
if ( title.val() == '' )
|
if ( title.val() == '' )
|
||||||
titleprompt.css('visibility', '');
|
titleprompt.removeClass('screen-reader-text');
|
||||||
|
|
||||||
titleprompt.click(function(){
|
titleprompt.click(function(){
|
||||||
$(this).css('visibility', 'hidden');
|
$(this).addClass('screen-reader-text');
|
||||||
title.focus();
|
title.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
title.blur(function(){
|
title.blur(function(){
|
||||||
if ( this.value == '' )
|
if ( this.value == '' )
|
||||||
titleprompt.css('visibility', '');
|
titleprompt.removeClass('screen-reader-text');
|
||||||
}).focus(function(){
|
}).focus(function(){
|
||||||
titleprompt.css('visibility', 'hidden');
|
titleprompt.addClass('screen-reader-text');
|
||||||
}).keydown(function(e){
|
}).keydown(function(e){
|
||||||
titleprompt.css('visibility', 'hidden');
|
titleprompt.addClass('screen-reader-text');
|
||||||
$(this).unbind(e);
|
$(this).unbind(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user