Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

dashifen on "TinyMCE Modification by Plugin Question"

$
0
0

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]


Viewing all articles
Browse latest Browse all 26892

Trending Articles