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


(string) (Required) Path to file.


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


(int) (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 );



Changelog Changelog

Version Description
2.5.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.