mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
git-svn-id: http://core.svn.wordpress.org/trunk@22702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
38b7b820aa
commit
3ac8cab666
@ -1328,13 +1328,13 @@ function wp_enqueue_media( $args = array() ) {
|
||||
), admin_url('media-upload.php') ),
|
||||
);
|
||||
|
||||
if ( isset( $args['post'] ) )
|
||||
$settings['postId'] = get_post( $args['post'] )->ID;
|
||||
|
||||
wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
|
||||
// Settings
|
||||
'settings' => $settings,
|
||||
$post = null;
|
||||
if ( isset( $args['post'] ) ) {
|
||||
$post = get_post( $args['post'] );
|
||||
$settings['postId'] = $post->ID;
|
||||
}
|
||||
|
||||
$strings = array(
|
||||
// Generic
|
||||
'url' => __( 'URL' ),
|
||||
'insertMedia' => __( 'Insert Media' ),
|
||||
@ -1369,7 +1369,14 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'updateGallery' => __( 'Update gallery' ),
|
||||
'continueEditing' => __( 'Continue editing' ),
|
||||
'addToGallery' => __( 'Add to gallery' ),
|
||||
) );
|
||||
);
|
||||
|
||||
$settings = apply_filters( 'media_view_settings', $settings, $post );
|
||||
$strings = apply_filters( 'media_view_strings', $strings, $post );
|
||||
|
||||
$strings['settings'] = $settings;
|
||||
|
||||
wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );
|
||||
|
||||
wp_enqueue_script( 'media-upload' );
|
||||
wp_enqueue_style( 'media-views' );
|
||||
|
Loading…
Reference in New Issue
Block a user