我是创建插件的初学者 我正在创建自定义插件 这是我的代码
defined('ABSPATH') or die('No script kiddies please!');
function reservationPlugin()
{
add_menu_page('Reservation', 'Reservation', 4, 'reservation-Option', 'exampleMenu', 'dashicons-calendar', 3);
}
function exampleMenu()
{
$content = '';
$editor_id = 'mycustomeditor';
wp_editor($content, $editor_id);
}
如何保存内容?
在这个节目在前面?
谢谢!!!
答案 0 :(得分:0)
您可以将其用作< textarea >并提交表格
$content = '';
if (isset($_POST) && !empty($_POST)) {
if (isset($_POST['submit']) && $_POST['submit'] != '') {
$content=$_POST['mycustomeditor'];
}
}
$editor_id = 'mycustomeditor';
?>
<form name="editorForm" method="post" action="">
<?
wp_editor($content, $editor_id);
submit_button('save');
?>
</form>