Make WordPress Core

Changeset 59511


Ignore:
Timestamp:
12/13/2024 09:51:41 PM (3 months ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r59188 r59511  
    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
Note: See TracChangeset for help on using the changeset viewer.