wp_tempnam [ WordPress Function ]
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Returns a filename of a Temporary unique file.
Please note that the calling function must unlink() this itself.
The filename is based off the passed parameter or defaults to the current unix timestamp, while the directory can either be passed as well, or by leaving it blank, default to a writable temporary directory.
Source
<?php
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;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- PHPXRef 0.7 : WordPress : Function Reference: wp_tempnam()
Function and Method Cross Reference. wp_tempnam(). Defined at: /wp-admin/ includes/file.php -> line 155. Referenced 5 times: ...
phpxref.ftwr.co.uk - #11601 (Touch error during plugin upgrade) – WordPress Trac
try var_dump(wp_tempnam()); instead of echo'ing it.. Looking at ... function wp_tempnam($filename = '', $dir = ''){ var_dump("wp_tempnam($filename, $dir)") ; ...
core.trac.wordpress.org - Docs for page file.php
wp_tempnam (line 168). Returns a filename of a Temporary unique file. Please note that the calling function must unlink() this itself. The filename is based off the ...
phpdoc.wordpress.org - WordPress › Support » [Plugin: WP Autoresponder And Newsletter ...
Unfortunately that doesn't work either. Apparently wordpress have patched around this and have a function called wp_tempnam() in wp-admin/includes/file. php.
wordpress.org