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

WordPress Trac noreply at wordpress.org
Tue Dec 5 13:44: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 has-unit-tests  |     Focuses:
----------------------------------------------------+---------------------

Comment (by chesio):

 Replying to [comment:17 lakshmananphp]:
 > I have a suggestion: can we add one more condition to this check?
 >
 >
 > {{{
 > if ($attachment_parent_id && 0 !== $attachment_parent_id ) {
 > // just to make sure that the attachment's parent id is not zero.
 > }}}

 This extra condition would be superfluous. If `$attachment_parent_id` is
 0, the first condition always fails and the extra condition is **never**
 executed.

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


More information about the wp-trac mailing list