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') ),
|
), admin_url('media-upload.php') ),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( isset( $args['post'] ) )
|
$post = null;
|
||||||
$settings['postId'] = get_post( $args['post'] )->ID;
|
if ( isset( $args['post'] ) ) {
|
||||||
|
$post = get_post( $args['post'] );
|
||||||
wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
|
$settings['postId'] = $post->ID;
|
||||||
// Settings
|
}
|
||||||
'settings' => $settings,
|
|
||||||
|
|
||||||
|
$strings = array(
|
||||||
// Generic
|
// Generic
|
||||||
'url' => __( 'URL' ),
|
'url' => __( 'URL' ),
|
||||||
'insertMedia' => __( 'Insert Media' ),
|
'insertMedia' => __( 'Insert Media' ),
|
||||||
|
@ -1369,7 +1369,14 @@ function wp_enqueue_media( $args = array() ) {
|
||||||
'updateGallery' => __( 'Update gallery' ),
|
'updateGallery' => __( 'Update gallery' ),
|
||||||
'continueEditing' => __( 'Continue editing' ),
|
'continueEditing' => __( 'Continue editing' ),
|
||||||
'addToGallery' => __( 'Add to gallery' ),
|
'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_script( 'media-upload' );
|
||||||
wp_enqueue_style( 'media-views' );
|
wp_enqueue_style( 'media-views' );
|
||||||
|
|
Loading…
Reference in New Issue