Allow methods to be used as a callback in wp_unique_filename(). fixes #12824 props aaroncampbell.
git-svn-id: http://svn.automattic.com/wordpress/trunk@13952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e7486800d9
commit
c905fc1420
|
@ -2209,7 +2209,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
|
|||
$name = '';
|
||||
|
||||
// Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
|
||||
if ( $unique_filename_callback && function_exists( $unique_filename_callback ) ) {
|
||||
if ( $unique_filename_callback && is_callable( $unique_filename_callback ) ) {
|
||||
$filename = $unique_filename_callback( $dir, $name );
|
||||
} else {
|
||||
$number = '';
|
||||
|
|
Loading…
Reference in New Issue