Changeset 20613
- Timestamp:
- 04/27/2012 04:08:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r20569 r20613 169 169 * @param int $attachment_id Attachment ID. 170 170 * @param bool $unfiltered Whether to apply filters. 171 * @return string The file path to the attached file.171 * @return string|bool The file path to the attached file, or false if the attachment does not exist. 172 172 */ 173 173 function get_attached_file( $attachment_id, $unfiltered = false ) { 174 174 $file = get_post_meta( $attachment_id, '_wp_attached_file', true ); 175 175 // If the file is relative, prepend upload dir 176 if ( 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )176 if ( $file && 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) ) 177 177 $file = $uploads['basedir'] . "/$file"; 178 178 if ( $unfiltered )
Note: See TracChangeset
for help on using the changeset viewer.