Make WordPress Core

Opened 7 years ago

Closed 21 months ago

#41363 closed defect (bug) (wontfix)

Document nocache_headers() usage in wp-admin/admin-post.php

Reported by: ronakganatra's profile ronakganatra Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: docs Cc:

Description

nocache_headers(); is used but unclear as to what it actually does. documentation need improvement

Attachments (1)

41363.patch (431 bytes) - added by ronakganatra 7 years ago.
added description for used function nocache_headers();

Download all attachments as: .zip

Change History (7)

@ronakganatra
7 years ago

added description for used function nocache_headers();

#1 @SergeyBiryukov
7 years ago

  • Component changed from Editor to Administration

Hi @ronakganatra, welcome to WordPress Trac! Thanks for the patch.

There are more than 15 instances of nocache_headers() calls in core though, adding a comment to only one of them seems inconsistent. The function itself already has a description, maybe it should be made clearer?

#2 @SergeyBiryukov
7 years ago

  • Summary changed from Needs improvements in the documentation of the function to Document nocache_headers() usage in wp-admin/admin-post.php

#3 follow-up: @pyrobd
2 years ago

Hello @SergeyBiryukov ,
Do you mean just adding comments to all the instances?

#4 in reply to: ↑ 3 @SergeyBiryukov
2 years ago

  • Keywords has-patch close added

Replying to pyrobd:

Do you mean just adding comments to all the instances?

Not really, I meant that the function itself already has a description to clarify its purpose, so I don't see a significant benefit in duplicating it in other instances. So unless there is something to improve in the function description, I think this ticket can be closed.

I guess the point of the ticket was that in this particular file, the send_origin_headers() call has a comment while nocache_headers() does not, which might seem a bit inconsistent. Then again, if the code is mostly self-documenting, I don't think it's necessary to add a comment for every single function call. Note that the send_origin_headers() comment does not just duplicate the function description but provides some more context.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#5 @pyrobd
2 years ago

Thanks Understood, I also think it can be closed, the existing description is pretty clear, just browsing through tickets to create my first accepted Patch.

#6 @desrosj
21 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.