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

WordPress Trac noreply at wordpress.org
Thu Nov 9 11:02:31 UTC 2023


#57913: Attachment pages need to have an "on" toggle
---------------------------------------------+-----------------------------
 Reporter:  joostdevalk                      |       Owner:  SergeyBiryukov
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.4
Component:  Media                            |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  add-to-field-guide has-dev-note  |     Focuses:
---------------------------------------------+-----------------------------

Comment (by chesio):

 Replying to [comment:68 joppuyo]:
 > While testing 6.4, I noticed that even if `attachment_pages_enabled` is
 set to `0` the redirection only kicks in for logged-in users. For
 anonymous users, the attachment page is still displayed. It seems this is
 because `read_post` capability
 [https://github.com/WordPress/WordPress/blob/e2d61d78ede843c2d05f44a4e15f30a57fb47d95
 /wp-includes/canonical.php#L553C11-L553C11 is checked before] the
 redirection is performed. Anonymous users don't have any capabilities so
 the redirection work in this case.
 >
 > Is this feature intended to work this way or is this an oversight in the
 implementation?

 I observed the same behaviour and I believe it's an oversight. The initial
 idea was to prevent such pages from being crawled and indexed by search
 engines, but this is obviously not the case.

 But since this ticket is closed and the feature has been shipped with 6.4
 already, I think creating a new ticket is the best way to proceed now.

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


More information about the wp-trac mailing list