wp_is_writable() WordPress Function

The wp_is_writable() function checks whether a file is writable by the WordPress process. This is useful for checking whether a file can be written to by a theme or plugin.

wp_is_writable( string $path ) #

Determine if a directory is writable.


Description

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

Top ↑

See also


Top ↑

Parameters

$path

(string)(Required)Path to check for write-ability.


Top ↑

Return

(bool) Whether the path is writable.


Top ↑

Source

File: wp-includes/functions.php

function wp_is_writable( $path ) {
	if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
		return win_is_writable( $path );
	} else {
		return @is_writable( $path );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More