Skip to content

Commit ab51fc3

Browse files
committed
Editor: Hide 'Skip to Editor' if editor not supported.
Wrap the classic editor 'Skip to Editor' link in a conditional to prevent it from rendering on post types that do not have editor support. Props wildworks, parthvataliya, narenin, sainathpoojary, ankitkumarshah, parthvataliya, im3dabasia1. Fixes #62623. git-svn-id: https://develop.svn.wordpress.org/trunk@59511 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 20982b7 commit ab51fc3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,13 @@
546546
?>
547547
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
548548
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
549-
<a href="#content" class="button-secondary screen-reader-text skiplink" onclick="if (tinymce) { tinymce.execCommand( 'mceFocus', false, 'content' ); }"><?php esc_html_e( 'Skip to Editor' ); ?></a>
549+
<?php
550+
if ( post_type_supports( $post_type, 'editor' ) ) {
551+
?>
552+
<a href="#content" class="button-secondary screen-reader-text skiplink" onclick="if (tinymce) { tinymce.execCommand( 'mceFocus', false, 'content' ); }"><?php esc_html_e( 'Skip to Editor' ); ?></a>
553+
<?php
554+
}
555+
?>
550556
</div>
551557
<?php
552558
/**

0 commit comments

Comments
 (0)