Changeset 3413 for trunk/wp-includes/functions-post.php
- Timestamp:
- 01/09/2006 10:24:57 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions-post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r3403 r3413 877 877 // Returns an array containing the current upload directory's path and url, or an error message. 878 878 function wp_upload_dir() { 879 $dir = trim(get_settings('fileupload_realpath')); 880 $url = trim(get_settings('fileupload_url')); 881 882 $custom = true; 883 if ( empty($dir) || empty($url) ) { 879 $siteurl = get_settings('siteurl'); 880 //prepend ABSPATH to $dir and $siteurl to $url if they're not already there 881 $dir = ABSPATH . str_replace(ABSPATH, '', trim(get_settings('fileupload_realpath'))); 882 $url = $siteurl . str_replace($siteurl, '', trim(get_settings('fileupload_url'))); 883 884 if ( $dir == ABSPATH ) { //the option was empty 884 885 $dir = ABSPATH . 'wp-content/uploads'; 885 $url = get_option('siteurl') . '/wp-content/uploads'; 886 $custom = false; 886 } 887 if ( $url == $siteurl ) { //the option was empty 888 $url = get_option('siteurl') . '/' . str_replace(ABSPATH, '', $dir); 887 889 } 888 890 … … 890 892 $dir = ABSPATH . UPLOADS; 891 893 $url = get_option('siteurl') . '/' . UPLOADS; 892 $custom = false; 893 } 894 895 if ( ! $custom) { 894 } 895 896 if ( get_settings('uploads_yearmonth_folders')) { 896 897 // Generate the yearly and monthly dirs 897 898 $time = current_time( 'mysql' );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)