W3cubDocs

/WordPress

wp_is_writable( string $path ): bool

Determines if a directory is writable.

Description

This function is used to work around certain ACL issues in PHP primarily affecting Windows Servers.

See also

Parameters

$pathstringrequired
Path to check for write-ability.

Return

bool Whether the path is writable.

Source

function wp_is_writable( $path ) {
	if ( 'Windows' === PHP_OS_FAMILY ) {
		return win_is_writable( $path );
	}

	return @is_writable( $path );
}

Changelog

Version Description
3.6.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_writable