Make WordPress Core


Ignore:
Timestamp:
04/05/2012 12:20:28 AM (13 years ago)
Author:
ryan
Message:

Allow selecting custom header and background images from the media library. Props aaroncampbell, sabreuse, greuben. fixes #19840

File:
1 edited

Legend:

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

    r20310 r20358  
    404404}
    405405
    406 function get_upload_iframe_src( $type = null, $post_id = null ) {
     406function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
    407407    global $post_ID;
    408408
     
    410410        $post_id = $post_ID;
    411411
    412     $uploading_iframe_ID = (int) $post_id;
    413     $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') );
     412    $upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url('media-upload.php') );
    414413
    415414    if ( $type && 'media' != $type )
    416415        $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);
     416
     417    if ( ! empty( $tab ) )
     418        $upload_iframe_src = add_query_arg('tab', $tab, $upload_iframe_src);
    417419
    418420    $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);
     
    498500        $attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
    499501
    500         $html = $attachment['post_title'];
     502        $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
    501503        if ( !empty($attachment['url']) ) {
    502504            $rel = '';
Note: See TracChangeset for help on using the changeset viewer.