Make WordPress Core

Changeset 19999


Ignore:
Timestamp:
02/27/2012 07:23:03 PM (13 years ago)
Author:
ryan
Message:

Pass post id to get_upload_iframe_src() instead of relying on a global. Props tott. fixes #20003

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r19982 r19999  
    393393}
    394394
    395 function get_upload_iframe_src( $type = null ) {
     395function get_upload_iframe_src( $type = null, $post_id = null ) {
    396396    global $post_ID;
    397397
    398     $uploading_iframe_ID = (int) $post_ID;
     398    if ( empty( $post_id ) )
     399        $post_id = $post_ID;
     400
     401    $uploading_iframe_ID = (int) $post_id;
    399402    $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') );
    400403
  • trunk/wp-admin/includes/post.php

    r19902 r19999  
    11531153        $post_id = $post_ID;
    11541154
    1155     $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image') ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
     1155    $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image', $post_id) ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
    11561156    $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
    11571157
Note: See TracChangeset for help on using the changeset viewer.