Definition:
function wp_tempnam($filename = '', $dir = '') {}
Returns a filename of a Temporary unique file.
Please note that the calling function must unlink() this itself.
Parameters
- string $filename: (optional) Filename to base the Unique file off
- string $dir: (optional) Directory to store the file in
Return values
returns:a writable filename
Source code
function wp_tempnam($filename = '', $dir = '') { if ( empty($dir) ) $dir = get_temp_dir(); $filename = basename($filename); if ( empty($filename) ) $filename = time(); $filename = preg_replace('|\..*$|', '.tmp', $filename); $filename = $dir . wp_unique_filename($dir, $filename); touch($filename); return $filename; }
4159
No comments yet... Be the first to leave a reply!