Make WordPress Core


Ignore:
Timestamp:
11/20/2012 02:58:33 AM (11 years ago)
Author:
nacin
Message:

Add media_view_settings and media_view_strings hooks. fixes #21092 for 3.5. see #21390.

File:
1 edited

Legend:

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

    r22677 r22702  
    13291329    );
    13301330
    1331     if ( isset( $args['post'] ) )
    1332         $settings['postId'] = get_post( $args['post'] )->ID;
    1333 
    1334     wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
    1335         // Settings
    1336         'settings' => $settings,
    1337 
     1331    $post = null;
     1332    if ( isset( $args['post'] ) ) {
     1333        $post = get_post( $args['post'] );
     1334        $settings['postId'] = $post->ID;
     1335    }
     1336
     1337    $strings = array(
    13381338        // Generic
    13391339        'url'         => __( 'URL' ),
     
    13701370        'continueEditing'    => __( 'Continue editing' ),
    13711371        'addToGallery'       => __( 'Add to gallery' ),
    1372     ) );
     1372    );
     1373
     1374    $settings = apply_filters( 'media_view_settings', $settings, $post );
     1375    $strings  = apply_filters( 'media_view_strings',  $strings,  $post );
     1376
     1377    $strings['settings'] = $settings;
     1378
     1379    wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );
    13731380
    13741381    wp_enqueue_script( 'media-upload' );
Note: See TracChangeset for help on using the changeset viewer.