wp_get_upload_dir

Retrieves uploads directory information.

Description

(array) wp_get_upload_dir(); 

Same as wp_upload_dir() but light weight as it doesn't attempt to create the uploads directory. Intended for use in themes, when only basedir and baseurl are needed, generally in all cases when not uploading files.

Returns (array)

See wp_upload_dir() for description.


Usage

  1. if ( !function_exists( 'wp_get_upload_dir' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_get_upload_dir(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function wp_get_upload_dir() { 
  2. return wp_upload_dir( null, false );