1

我正在尝试编写一些插件按钮,它们将在 WordPress TinyMce 编辑器中生成一些插件。

除了代码如下所示,一切都 100% 正常运行:

[accordion_wrap] [accordions]This is where some content goes..[/accordions] [accordions]This is where some content goes..[/accordions] [accordions]This is where some content goes..[/accordions] [/accordion_wrap]

而不是看起来像这样

[accordion_wrap]

[accordions]This is where some content goes...[/accordions]
[accordions]This is where some content goes...[/accordions]
[accordions]This is where some content goes...[/accordions]

[/accordion_wrap]

我这样做的代码如下:

   if(p == 'Accordions'){

    content =  '[accordion_wrap]'+'\n'+'[accordions]This is where some content goes...[/accordions]'+'\n'+'[accordions]This is where some content goes...[/accordions]'+'\n'+'[accordions]This is where some content goes...[/accordions]'+'\n'+'[/accordion_wrap]';

  tinymce.execCommand('mceInsertContent', false, content);

    } // end of shortcode

有人可以指出我做错了什么。

谢谢

4

0 回答 0