Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#20311 closed enhancement (invalid)

Docblock error for wp_unique_filename

Reported by: transom Owned by:
Priority: normal Milestone:
Component: Inline Docs Version: 3.4
Severity: trivial Keywords: has-patch
Cc: Focuses:

Description

The current docblock for wp_unique_filename inaccurately describes the third parameter passed to this function

Attachments (2)

wp_unique_filename_docblock.diff (477 bytes ) - added by transom 14 years ago.
Update docblock for wp_unique_filename
20311-1.diff (508 bytes ) - added by jkudish 14 years ago.
amended the original patch

Download all attachments as: .zip

Change History (8)

@transom
14 years ago

Update docblock for wp_unique_filename

#1 @helenyhou
14 years ago

  • Component GeneralInline Docs
  • Keywords needs-refresh added

A note: patches should be made from root.

@jkudish
14 years ago

amended the original patch

#2 @jkudish
14 years ago

  • Cc joachim.kudish@… added
  • Keywords needs-refresh removed
  • Severity normaltrivial

Amended transom's initial patch with the right format :)

#3 @transom
14 years ago

Damn, and I know better - thanks all.

#4 @SergeyBiryukov
14 years ago

  • Keywords commit added

#5 @SergeyBiryukov
14 years ago

  • Milestone Awaiting Review3.5

#6 @nacin
14 years ago

  • Keywords commit removed
  • Milestone 3.5
  • Resolutioninvalid
  • Status newclosed

The documentation itself appears wrong.

 * The callback is passed three parameters, the first one is the directory, the
 * second is the filename, and the third is an optional supplied callback
 * to generate a unique filename.

This paragraph is not talking about the function, whose third argument is indeed the optional supplied callback. This is talking about how the supplied callback gets called. As you can see, the third argument is indeed the extension:

call_user_func( $unique_filename_callback, $dir, $name, $ext );
Note: See TracTickets for help on using tickets.