Title: TinyMCE shortcode buttons question
Last modified: August 30, 2016

---

# TinyMCE shortcode buttons question

 *  [Ciredor](https://wordpress.org/support/users/ciredor/)
 * (@ciredor)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/tinymce-shortcode-buttons-question/)
 * Recently i found this article [wordpress-tinymce-tweaks](http://www.wpexplorer.com/wordpress-tinymce-tweaks/)
   about making tinyMCE buttons for shortcodes with popup window. This stuff is 
   sick and working great so far but it can’t wrap selected text in shortcode.
    
   I know basics of how it work like:
 *     ```
       selected = tinyMCE.activeEditor.selection.getContent();
       	if( selected ){
               content =  '[shortcode]'+selected+'[/shortcode]';
           }else{
               content =  '[shortcode]';
       	}
       ```
   
 * but i don’t have any idea how to include it in buttons made with that tutorial.
   Any ideas ?

The topic ‘TinyMCE shortcode buttons question’ is closed to new replies.

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [tinymce](https://wordpress.org/support/topic-tag/tinymce/)

 * 0 replies
 * 1 participant
 * Last reply from: [Ciredor](https://wordpress.org/support/users/ciredor/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/tinymce-shortcode-buttons-question/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
