WP_Filesystem_Direct::touch

Advertisement

Summery Summery

Sets the access and modification times of a file.

Syntax Syntax

WP_Filesystem_Direct::touch( string $file, int $time, int $atime )

Description Description

Note: If $file doesn’t exist, it will be created.

Parameters Parameters

$file

(Required) Path to file.

$time

(Optional) Modified time to set for file. Default 0.

$atime

(Optional) Access time to set for file. Default 0.

Return Return

(bool) True on success, false on failure.

Source Source

File: wp-admin/includes/class-wp-filesystem-direct.php

	 *
	 * @param string $file Path to file.
	 * @return int|false Unix timestamp representing modification time, false on failure.
	 */
	public function mtime( $file ) {
		return @filemtime( $file );
	}

	/**

Advertisement

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Advertisement

Leave a Reply