- if ( current_user_can('upload_files') ) : ?>
- <a id="photo_button" title="<?php _e('Insert an Image'); ?>" href="#">
-<img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a><?php
- endif;
- ?><a id="video_button" title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
- </div>
- </div>
- <div id="quicktags"></div>
- <div class="editor-container">
- <textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php
- if ( $selection )
- echo wp_richedit_pre($selection);
- if ( $url ) {
- echo '<p>';
- if ( $selection )
- _e('via ');
- printf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
- }
- ?></textarea>
- </div>
+ $editor_settings = array(
+ 'teeny' => true,
+ 'textarea_rows' => '15'
+ );
+
+ $content = '';
+ if ( $selection )
+ $content .= $selection;
+
+ if ( $url ) {
+ $content .= '<p>';
+
+ if ( $selection )
+ $content .= __('via ');
+
+ $content .= sprintf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
+ }
+
+ remove_action( 'media_buttons', 'media_buttons' );
+ add_action( 'media_buttons', 'press_this_media_buttons' );
+ function press_this_media_buttons() {
+ _e( 'Add:' );
+
+ if ( current_user_can('upload_files') ) {
+ ?>
+ <a id="photo_button" title="<?php esc_attr_e('Insert an Image'); ?>" href="#">
+ <img alt="<?php esc_attr_e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a>
+ <?php
+ }
+ ?>
+ <a id="video_button" title="<?php esc_attr_e('Embed a Video'); ?>" href="#"><img alt="<?php esc_attr_e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
+ <?php
+ }
+
+ wp_editor( $content, 'content', $editor_settings );
+
+ ?>