3

Is it possible to change shortcode appearance in Wordpress TinyMCE editor? One of my clients has no HTML knowledge and it's really hard to explain him what not to edit on subpages.

All I want is to hide the shortcodes and add a button on the kitchen sink to show them.

Work arounds. 1 - Filter content before displaying in the editor. Onclick of the button in kitchen sink, call the same url with a $_GET param e.g ?filter=false and do not filter the content this time.

2 - Wrap all shortcodes in a div with a specific class before displaying and toggle that class onclick of the button in the kitchen sink.

For both ways I need to get the content before displaying it in TinyMCE so that I can modify it. Unable to do so .. please help.

P.S: this needs to be done in a plugin. cannot modify core wordpress files.

4

1 回答 1

0

您可以使用 tinymce 参数“设置”并创建一个 onBeforeSetContent 处理程序。这样,您可以在内容进入编辑器并执行操作 2 之前对其进行修改。

于 2013-07-29T10:30:18.767 回答