Make WordPress Core

Opened 12 months ago

Closed 11 months ago

Last modified 6 months ago

#62623 closed defect (bug) (fixed)

Classic Editor: The "Skip to Editor" button is displayed even though the editor is not supported

Reported by: wildworks's profile wildworks Owned by: joedolson's profile joedolson
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-test-info has-patch has-screenshots commit
Focuses: Cc:

Description

Related ticket: #29838

When the tab key is pressed after focusing on a post title, the "Skip to Editor" link button appears to move focus to the editor.

However, a post type may not support the editor. If the editor is disabled and this link button is accessed, focus will be lost.

Attachments (3)

Custom post type that doesn't support the editor.png (34.6 KB) - added by wildworks 12 months ago.
Custom post type that doesn't support the editor
before-patch.mp4 (280.7 KB) - added by parthvataliya 12 months ago.
after-patch.mp4 (268.9 KB) - added by parthvataliya 12 months ago.

Download all attachments as: .zip

Change History (17)

@wildworks
12 months ago

Custom post type that doesn't support the editor

#1 @joedolson
12 months ago

  • Milestone changed from Awaiting Review to 6.8
  • Owner set to joedolson
  • Status changed from new to accepted

#2 @narenin
12 months ago

  • Keywords has-testing-info added

Test Report

Environment
PHP: 8.0
WordPress: 6.7.1
Active Plugins:
Classic Editor 1.6.5
Actual Results

❌ In the Classic Editor the "Skip to Editor" button is displayed even though the editor is not supported for that Post Type.

#3 @sainathpoojary
12 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Plugin

Actual Results

✅ Error condition occurs.

Supplemental Artifacts

https://utfs.io/f/PL8E4NiPUWyOZxgF6jGJy8ZehF2cujNOPAoRHWdYL45tbmXG

This ticket was mentioned in PR #7924 on WordPress/wordpress-develop by @sainathpoojary.


12 months ago
#4

  • Keywords has-patch added

### Summary
This PR resolves an issue where the "Skip to Editor" button is displayed even when the post type does not support the editor, leading to focus loss when the link is accessed.

### Changes Introduced
Added a conditional check using post_type_supports( $post_type, 'editor' ) to ensure the "Skip to Editor" link is displayed only if the editor is supported by the post type.

### Testing Instructions

  1. Register a post type without the editor (exclude 'editor' in the supports array during registration).
  2. Go to the "Add New" screen for the registered post type.
  3. Verify that the "Skip to Editor" link is no longer displayed.
  4. Test with post types that do support the editor to confirm the link appears and functions as expected.

### Before fix
https://github.com/user-attachments/assets/545d1471-7d8a-42a9-a4ac-f7518c65617c

### After fix
https://github.com/user-attachments/assets/2b21f992-212f-4939-a7af-a6982f0877eb

---

Trac ticket: #62623

@narenin commented on PR #7924:


12 months ago
#5

@SainathPoojary The PR looks good to me.

#6 @narenin
12 months ago

Test Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/7924

Environment
PHP: 8.0
WordPress: 6.7.1
Active Plugins:
Classic Editor 1.6.5

Actual Results:

✅ In the Classic Editor the "Skip to Editor" button is displayed only when the editor is support for that Post Type.

✅ The patch is working fine and showing the expected result.

#7 @ankitkumarshah
12 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/7924

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

Hello @wildworks,
Thank you for highlighting this issue. I was able to successfully reproduce it on my end. After applying the patch provided by @sainathpoojary, the problem was resolved.

Supplemental Artifacts

Before Patch

https://utfs.io/f/TnWMEUzoUd85lEgmF79YW9Jq34mQpr7vHsZNoFtMB5gwRIhn

After Patch

https://utfs.io/f/TnWMEUzoUd859zDfTFRL0xGfdFtipMBeAnPoCjkyzghVv7Hq

#8 @parthvataliya
12 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/7924.diff

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: Linux
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

#9 @im3dabasia1
12 months ago

  • Keywords has-screenshots added

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Supplemental Artifacts

https://i.postimg.cc/qMWT1rD0/Screenshot-2024-12-02-at-7-25-36-PM.png

#10 @im3dabasia1
12 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/7924.diff

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.6
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • Any additional details worth mentioning.

Supplemental Artifacts

https://drive.google.com/file/d/1bco0M9DQVRCkpx-nI-aaBELB06BUOZEd/view?usp=sharing

#11 @joedolson
11 months ago

  • Keywords commit added

Patch is straightforward and works as expected; marking for commit.

#12 @joedolson
11 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 59511:

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.

@sainathpoojary commented on PR #7924:


9 months ago
#13

Merged in the changeset - 59511

#14 @wordpressdotorg
6 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.