Make WordPress Core

Ticket #21092: 21092.patch

File 21092.patch, 957 bytes (added by ocean90, 13 years ago)
  • wp-includes/media.php

     
    13281328                ), admin_url('media-upload.php') ),
    13291329        );
    13301330
    1331         if ( isset( $args['post'] ) )
    1332                 $settings['postId'] = get_post( $args['post'] )->ID;
     1331        $post = null;
     1332        if ( isset( $args['post'] ) ) {
     1333                $post = get_post( $args['post'] );
     1334                $settings['postId'] = $post->ID;
     1335        }
    13331336
    1334         wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
     1337        wp_localize_script( 'media-views', '_wpMediaViewsL10n', apply_filters( 'media_views_l10n', array(
    13351338                // Settings
    13361339                'settings' => $settings,
    13371340
     
    13751378                'updateGallery'      => __( 'Update gallery' ),
    13761379                'continueEditing'    => __( 'Continue editing' ),
    13771380                'addToGallery'       => __( 'Add to gallery' ),
    1378         ) );
     1381        ), $post ) );
    13791382
    13801383        wp_enqueue_script( 'media-upload' );
    13811384        wp_enqueue_style( 'media-views' );