From c905fc1420e1b74dda3b48589e3df962999e1bc6 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 2 Apr 2010 23:54:56 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 932c6f399..e0b5e01a6 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 = '';