wppaste
WordPress

apply_filters( 'upload_dir', array $uploads )

Since
2.0.0
Filters the uploads directory data.

Compatibility

WordPress
since 2.0.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$uploadsarray
{ Array of information about the upload directory.
@type string $path Base directory and subdirectory or full path to upload directory.
@type string $url Base URL and subdirectory or absolute URL to upload directory.
@type string $subdir Subdirectory if uploads use year/month folders option is on.
@type string $basedir Path without subdir.
@type string $baseurl URL path without subdir.
@type string|false $error False or error message.
}
  • $pathstring

    Base directory and subdirectory or full path to upload directory.
  • $urlstring

    Base URL and subdirectory or absolute URL to upload directory.
  • $subdirstring

    Subdirectory if uploads use year/month folders option is on.
  • $basedirstring

    Path without subdir.
  • $baseurlstring

    URL path without subdir.
  • $errorstring|false

    False or error message.

Where this hook fires · 1

  • wp-includes/functions.php:2406wp_upload_dir()

Source code

	 *     @type string       $subdir  Subdirectory if uploads use year/month folders option is on.	 *     @type string       $basedir Path without subdir.	 *     @type string       $baseurl URL path without subdir.	 *     @type string|false $error   False or error message.	 * }	 */	$uploads = apply_filters( 'upload_dir', $cache[ $key ] ); 	if ( $create_dir ) {		$path = $uploads['path']; 		if ( array_key_exists( $path, $tested_paths ) ) {			$uploads['error'] = $tested_paths[ $path ];

Changelog

Introduced in 2.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.