Skip to content
Browse files

DFW: check if the Add Image button is enabled in ms mode before using…

… it, props nacin, fixes #17942

git-svn-id: http://svn.automattic.com/wordpress/trunk@18380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 16f9195 commit f158ed15d2a494512c75c583b06d95666fc11a6a azaozz committed Jun 30, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 wp-admin/includes/post.php
View
6 wp-admin/includes/post.php
@@ -1792,6 +1792,10 @@ function wp_fullscreen_html() {
<div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="wp_themeSkin">
<?php
+ $media_link_type = 'image';
+ if ( is_multisite() && ( ( ! $mu_media_buttons = get_site_option( 'mu_media_buttons' ) ) || empty( $mu_media_buttons['image'] ) ) )
+ $media_link_type = 'media';
+
$buttons = array(
// format: title, onclick, show in both editors
'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false ),
@@ -1801,7 +1805,7 @@ function wp_fullscreen_html() {
'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false ),
'1' => 'separator',
'blockquote' => array( 'title' => __('Blockquote (Alt+Shift+Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false ),
- 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "jQuery('#add_image').click();", 'both' => true ),
+ 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "jQuery('#add_{$media_link_type}').click();", 'both' => true ),
'2' => 'separator',
'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true ),
'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false ),

0 comments on commit f158ed1

Please sign in to comment.
Something went wrong with that request. Please try again.