WordPress at a glance
filter is not described

upload_dir filter-hook . WP 2.0.0

Filters the uploads directory data.


add_filter( 'upload_dir', 'filter_function_name_1889' );
function filter_function_name_1889( $uploads ){
	// filter...

	return $uploads;

Array of information about the upload directory.

  • $path (string)
    Base directory and subdirectory or full path to upload directory.

  • $url (string)
    Base URL and subdirectory or absolute URL to upload directory.

  • $subdir (string)
    Subdirectory if uploads use year/month folders option is on.

  • $basedir (string)
    Path without subdir.

  • $baseurl (string)
    URL path without subdir.

  • $error (string/false)
    False or error message.


Since 2.0.0 Introduced.

Where the hook is called

wp-includes/functions.php 2294
$uploads = apply_filters( 'upload_dir', $cache[ $key ] );

Where in WP core the hook is used

Usage not found!