Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#63704 closed defect (bug) (fixed)

Docs: Fix typo and mark unused parameter in deprecated functions

Reported by: bhaveshdesai's profile bhaveshdesai Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: minor Version:
Component: General Keywords:
Focuses: docs Cc:

Description (last modified by mukesh27)

This patch fixes a typo in the documentation comment for the get_udims() function in wp-admin/includes/deprecated.php ("Calculated" → "Calculates").

It also adds a comment to mark the unused $fp parameter in the debug_fclose() function in wp-includes/deprecated.php to avoid unused parameter warnings.

These are minor documentation/code quality improvements.

Attachments (2)

63704.patch (1.0 KB) - added by bhaveshdesai 5 months ago.
Patch to fix typo in get_udims() and mark unused parameter in debug_fclose().
63704.1.patch (450 bytes) - added by sabernhardt 5 months ago.
fixes typo in get_udims() (only)

Download all attachments as: .zip

Change History (6)

#1 @mukesh27
5 months ago

  • Description modified (diff)
  • Keywords dev-feedback added
  • Version 6.8.2 deleted

Hi there!

Welcome to Trac, and thank you for creating the ticket.

Since those functions are deprecated, it doesn't make sense to update them at this point. I've marked the ticket for developer feedback to confirm whether we plan to update these files or leave them as is.

@bhaveshdesai
5 months ago

Patch to fix typo in get_udims() and mark unused parameter in debug_fclose().

@sabernhardt
5 months ago

fixes typo in get_udims() (only)

#2 follow-up: @sabernhardt
5 months ago

  • Focuses docs added; coding-standards removed
  • Keywords close 2nd-opinion added
  • Severity changed from normal to minor

I think I prefer not to make any of these revisions, but I made a patch with only the first.

  1. "Calculated" could be worth changing to "Calculates", but three commits—while get_udims() was still in use—did not fix that typo when they edited other parts of the same line.
    (either r8912, r9119, or r18632)
  2. debug_fclose() already identifies that the $fp parameter is unused.
     * @param mixed $fp Unused.
    
  3. Adding an extra space in the str_replace parameters is not a good idea in a deprecated function. If matching '<img ' instead of '<img' somehow could prevent a problem, four (non-deprecated) functions in wp-includes/media.php use '<img' without the space.

#3 in reply to: ↑ 2 @SergeyBiryukov
5 months ago

  • Keywords dev-feedback close 2nd-opinion removed
  • Milestone changed from Awaiting Review to 6.9

Replying to sabernhardt:

"Calculated" could be worth changing to "Calculates"

Let's do that :)

#4 @SergeyBiryukov
5 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 60488:

Docs: Fix typo in get_udims() description.

Follow-up to [6309], [8912], [9119], [18632].

Props bhaveshdesai, sabernhardt, mukesh27.
Fixes #63704.

Note: See TracTickets for help on using tickets.