Changeset 18799 for trunk/wp-includes/class-wp-editor.php
- Timestamp:
- 09/28/2011 07:26:34 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-editor.php
r18766 r18799 26 26 var $this_tinymce = false; 27 27 var $this_quicktags = false; 28 var $has_tinymce = false; 29 var $has_quicktags = false; 30 var $has_medialib = false; 28 31 29 32 function __construct() { … … 68 71 if ( $this->this_quicktags && $this->this_tinymce ) { 69 72 $switch_class = 'html-active'; 73 $this->has_tinymce = $this->has_quicktags = true; 70 74 71 75 if ( 'html' == $this->default_editor ) { … … 78 82 $buttons .= '<a id="' . $editor_id . '-html" class="hide-if-no-js wp-switch-editor switch-html" onclick="switchEditors.go(this);return false;">' . __('HTML') . "</a>\n"; 79 83 $buttons .= '<a id="' . $editor_id . '-tmce" class="hide-if-no-js wp-switch-editor switch-tmce" onclick="switchEditors.go(this);return false;">' . __('Visual') . "</a>\n"; 84 } else { 85 if ( $this->this_tinymce ) 86 $this->has_tinymce = true; 87 88 if ( $this->this_quicktags ) 89 $this->has_quicktags = true; 80 90 } 81 91 … … 90 100 91 101 if ( $set['media_buttons'] ) { 102 $this->has_medialib = true; 103 92 104 if ( !function_exists('media_buttons') ) 93 105 include(ABSPATH . 'wp-admin/includes/media.php'); … … 443 455 wp_enqueue_style('editor-buttons'); 444 456 445 if ( $this-> this_tinymce )457 if ( $this->has_tinymce ) 446 458 wp_enqueue_script('editor'); 447 459 448 if ( $this-> this_quicktags )460 if ( $this->has_quicktags ) 449 461 wp_enqueue_script('quicktags'); 450 462 … … 458 470 wp_enqueue_script('wp-fullscreen'); 459 471 460 add_thickbox(); 461 wp_enqueue_script('media-upload'); 472 if ( $this->has_medialib ) { 473 add_thickbox(); 474 wp_enqueue_script('media-upload'); 475 } 462 476 } 463 477 … … 801 815 } 802 816 803
Note: See TracChangeset
for help on using the changeset viewer.