WordPress.org

Make WordPress Core

Changeset 11493


Ignore:
Timestamp:
05/30/09 10:02:01 (6 years ago)
Author:
westi
Message:

Move the upload_dir filter before the directory is created so that plugins can have a better effect. Fixes #9973 props dd32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r11450 r11493  
    20002000    $url .= $subdir; 
    20012001 
     2002    $uploads = apply_filters( 'upload_dir', array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ) ); 
     2003 
    20022004    // Make sure we have an uploads dir 
    2003     if ( ! wp_mkdir_p( $dir ) ) { 
    2004         $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $dir ); 
     2005    if ( ! wp_mkdir_p( $uploads['path'] ) ) { 
     2006        $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $uploads['path'] ); 
    20052007        return array( 'error' => $message ); 
    20062008    } 
    20072009 
    2008     $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); 
    2009  
    2010     return apply_filters( 'upload_dir', $uploads ); 
     2010    return $uploads; 
    20112011} 
    20122012 
Note: See TracChangeset for help on using the changeset viewer.