Make WordPress Core


Ignore:
Timestamp:
02/22/2010 04:54:51 PM (17 years ago)
Author:
ryan
Message:

Pass overrides. Allow ref array calling. Props tychay. fixes #12278

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r13283 r13290  
    178178 * @since unknown
    179179 *
    180  * @param unknown_type $file_id
    181  * @param unknown_type $post_id
    182  * @param unknown_type $post_data
    183  * @return unknown
    184  */
    185 function media_handle_upload($file_id, $post_id, $post_data = array()) {
    186         $overrides = array('test_form'=>false);
     180 * @param string $file_id Index into the {@link $_FILES} array of the upload
     181 * @param int $post_id The post ID the media is associated with
     182 * @param array $post_data allows you to overwrite some of the attachment
     183 * @param array $overrides allows you to override the {@link wp_handle_upload()} behavior
     184 * @return int the ID of the attachment
     185 */
     186function media_handle_upload($file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false )) {
    187187
    188188        $time = current_time('mysql');
    … …  
    462462                $html = $attachment['post_title'];
    463463                if ( !empty($attachment['url']) ) {
     464                        $rel = '';
    464465                        if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) )
    465466                                $rel = " rel='attachment wp-att-" . esc_attr($send_id)."'";
Note: See TracChangeset for help on using the changeset viewer.