WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp is writable

Contents

Description

Determine if a path is writable. This is a wrapper function that detects if you're using Microsoft Windows, and uses the correct function for your OS.

Parameters

$path
(string) (required) the path to the file or directory that you want to use.
Default: None

Return

(bool) 
returns 'true' if writable. Otherwise 'false.

Usage

 <?php $is_writable wp_is_writable($path); ?> 

Example

Can be used in your theme or plugin.

$path = WP_CONTENT . '/uploads';

if (wp_is_writable($path)){
    // upload your file to here
}

Change Log

Source File

wp_is_writable is located in wp-includes/functions.php.

Related

This article is marked as in need of editing. You can help Codex by editing it.