[wp-trac] [WordPress Trac] #59866: Attachment pages are only disabled for users that are logged in

WordPress Trac noreply at wordpress.org
Thu Nov 9 13:20:42 UTC 2023


#59866: Attachment pages are only disabled for users that are logged in
-------------------------------------+---------------------
 Reporter:  joppuyo                  |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  6.4.2
Component:  Media                    |     Version:  6.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------

Comment (by afercia):

 To Test instructions:

 Before the patch:
 - Test with a fresh install of WordPress 6.4 with a fresh database.
 - Alternatively test with WordPress 6.4 and make sure your database has a
 `wp_attachment_pages_enabled` option set to `0` in the `wp_options` table.
 - I guess you can also use this filter somewhere: `add_filter(
 'pre_option_wp_attachment_pages_enabled', '__return_false' );`
 - Create a post, add an image block and link the image to its attachment
 page.
 - Publish the post.
 - View the front end as a logged in user.
 - Click the image and observe you are redirected to the media file.
 - View the front end as a logged out user.
 - Click the image and observe you are redirected to the attachment page.

 After the patch:
 - View the front end as a logged in user.
 - Click the image and observe you are redirected to the media file.
 - View the front end as a logged out user.
 - Click the image and observe you are redirected to the media file.

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


More information about the wp-trac mailing list