在我的编辑器中,我想使用TinyMCE生成的弹出窗口在textarea中插入一些复杂的短代码。我使用TinyMCE API显示弹出窗口(此问题的底部)。弹出窗口是我的主题中的一个PHP文件。我想:
保护此文件不受外部访问(if ( ! defined( \'ABSPATH\' ) )
不工作)
TinyMCE API调用
init : function(ed, url) {
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand(\'mcecax_webnews\');
ed.addCommand(\'mcecax_webnews\', function() {
ed.windowManager.open({
file : url + \'/dialog.php\',
width : 650 + ed.getLang(\'cax_webnews.delta_width\', 0),
height : 500 + ed.getLang(\'cax_webnews.delta_height\', 0),
inline : 1
}, {
plugin_url : url, // Plugin absolute URL
some_custom_arg : \'custom arg\' // Custom argument
});
});
[...] CUTTED