wpcf7_init_uploads()CF7 1.0

Initializes the temporary directory for uploaded files.

Хуков нет.

Возвращает

null. Ничего.

Использование

wpcf7_init_uploads();

Код wpcf7_init_uploads() CF7 5.6.4

function wpcf7_init_uploads() {
	$dir = wpcf7_upload_tmp_dir();

	if ( is_dir( $dir ) and is_writable( $dir ) ) {
		$htaccess_file = path_join( $dir, '.htaccess' );

		if ( ! file_exists( $htaccess_file )
		and $handle = @fopen( $htaccess_file, 'w' ) ) {
			fwrite( $handle, "Deny from all\n" );
			fclose( $handle );
		}
	}
}