Title: TinyMCE Modification by Plugin Question
Last modified: August 20, 2016

---

# TinyMCE Modification by Plugin Question

 *  [David Dashifen Kees](https://wordpress.org/support/users/dashifen/)
 * (@dashifen)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/tinymce-modification-by-plugin-question/)
 * Greetings,
 * I’ve got an interesting problem to solve. I’ve been asked to create a custom 
   post type to enumerate some additional content on the site. That part’s done.
   But, the next step is the one that’s gotten me completely lost.
 * The next step of the project is to add a button to the TinyMCE editor for Pages
   and Posts that, when clicked, opens a popup dialog. This dialog has to list the
   content that was added using the custom post type mentioned above by title, allow
   the visitor to select between them, and then return a shortcode to the editor
   when they make their selection.
 * I’ve got most of this put together, but I can’t for the life of me figure out
   two things:
    1. Once the TinyMCE popup is opened (with the editor.windowManager.open() TinyMCE
       function), I can’t figure out how to close it by any method other than clicking
       the close-button in the upper right.
    2. Further, I’m not sure how, once it’s closed, to “send” data from the popup back
       into the primary document. It’s all JavaScript, so I could use the window Object
       to make it happen, but that seems like poor programming practice.
 * I’ve written TinyMCE plugins before, but never from within WordPress and the 
   environment is different enough that I’m a bit lost. Any help would be appreciated.
 * Thanks,
    David Dashifen Kees _[sig moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome)]_

The topic ‘TinyMCE Modification by Plugin Question’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [David Dashifen Kees](https://wordpress.org/support/users/dashifen/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/tinymce-modification-by-plugin-question/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
