如何在Wordpress编辑器中使用php添加图像?

时间:2016-09-27 18:00:49

标签: php wordpress editor wp-editor

我使用wordpress主题。此主题在编辑器面板上包含class MyComparer : IComparer<object> { private readonly IDictionary<int, int> preferences; public MyComparer(IDictionary<int, int> preferences) { this.preferences = preferences; } public int Compare(object a, object b) { ... // Perform the comparison with preferences in scope } } 。我的代码是:

wp_editor

那么,如何以编程方式将图像添加到此编辑器中,当用户打开此页面时,图像将出现在编辑器中...

谢谢!

1 个答案:

答案 0 :(得分:0)

如果您想使用内置的wordpress媒体上传器,只需将media_buttons的值更改为true:

wp_editor('', lovephotoValue, $settings = array(
   'quicktags'=>1,
   'tinymce'=>1,
   'media_buttons'=>true,
   'textarea_rows'=>10, 
   'editor_class'=>"textareastyle"
));