[wp-trac] [WordPress Trac] #57913: Attachment pages need to have an "on" toggle

WordPress Trac noreply at wordpress.org
Wed Sep 20 13:46:21 UTC 2023


#57913: Attachment pages need to have an "on" toggle
------------------------------------------------+---------------------
 Reporter:  joostdevalk                         |       Owner:  (none)
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  6.4
Component:  Media                               |     Version:
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch needs-docs needs-testing  |     Focuses:
------------------------------------------------+---------------------

Comment (by zunaid321):

 == Test Report
 This report validates that the indicated patch addresses the issue.

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

 === Environment
 - OS: Windows 11 (22H2)
 - Web Server: nginx/1.25.1
 - PHP: 7.4.33
 - WordPress: 6.4-alpha-56267-src
 - Browser: Chrome Version 113.0.5672.126 (Official Build) (64-bit)
 - Theme: Twenty Twenty-Three (V1.2)
 - Plugins: [https://core.trac.wordpress.org/attachment/ticket/57913/57913
 -toggle-wp-attachment-pages-enabled.zip 57913-toggle-wp-attachment-pages-
 enabled.zip]

 === Instructions
 - Apply the patch
 - Upload and activate the attached plugin
 - Navigate to Media > Library.
 - Upload an image
 - Click on a media item, then click View attachment page. Expected: An
 attachment page should load.
 - Click the Disable Attachment Pages link in the admin bar.
 - Refresh the page. Expected: The media file should be directly loaded
 instead of an attachment page.
 - Navigate back to WordPress administration area and click Enable
 Attachment Pages to restore the original value.

 == Actual Results
 - ✅ With `wp_attachment_pages_enabled` enabled: The attachment page
 continues to load as normal.
 - ✅ With `wp_attachment_pages_enabled` disabled: The attachment file is
 loaded directly for plain and numeric permalinks.
 - ❌ With `wp_attachment_pages_enabled` disabled: The attachment page
 loads for non-plain/numeric permalinks.

 === Notes
 The patch works for plain and numeric permalinks, but not for the other
 permalink structure presets or a custom permalink structure.

 - For Plain and Numeric ✅
 - For Other Permalink Structures (Including Custom Structure with all the
 available tags) ❌

 === Supplemental Artifacts
 For Plain and Numeric: [https://i.imgur.com/PmFdrXr.png]
 For Other Permalink Structures: [https://i.imgur.com/TghCSlg.png]

 Special thanks to @costdev for providing the instructions and the custom
 plugin!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57913#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list