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

WordPress Trac noreply at wordpress.org
Thu Mar 16 18:26:26 UTC 2023


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

Comment (by SergeyBiryukov):

 Replying to [comment:17 eatingrules]:
 > (I don't like the idea of the toggle either, but... perhaps this could
 be more like the old "Links" feature. If it was in use, it stays in
 use...)

 Yeah, that could be implemented if that's the consensus here:
 * Keep the upgrade routine from the previous iteration of the PR, which
 would set an option, e.g. `wp_attachment_pages_enabled` (to follow the
 `link_manager_enabled` precedent), so that existing sites don't need to do
 anything to keep the current behavior.
 * For new sites, set the `wp_attachment_pages_enabled` to `0` by default.
 * Older sites that want to disable the attachment pages can also set the
 option to `0`.
 * If either of these two values is truthy, keep attachment pages as is:
  * `current_theme_supports( 'attachment-pages' )`
  * `get_option( 'wp_attachment_pages_enabled' )`
 * Otherwise, redirect to the attachment URL.

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


More information about the wp-trac mailing list