我有一个wordpress网站,我在帖子中添加了自定义元框。
自定义元框有一个使用wp\\u editor()的编辑器,但编辑器拒绝在编辑器面板上显示视觉/文本选项卡。
我已经停用了开发中的所有插件,问题仍然存在。
有人能帮我吗?
我有一个wordpress网站,我在帖子中添加了自定义元框。
自定义元框有一个使用wp\\u editor()的编辑器,但编辑器拒绝在编辑器面板上显示视觉/文本选项卡。
我已经停用了开发中的所有插件,问题仍然存在。
有人能帮我吗?
如果没有看到您的代码,我不能说有什么问题,但这里有一个正在运行(测试)的元盒示例,其中包含一个编辑器,其中包含视觉/文本选项卡。
add_action( \'add_meta_boxes\', function() {
add_meta_box(\'html_myid_61_section\', \'Meta Box Title\', \'my_custom_meta_function\');
});
function my_custom_meta_function( $post ) {
$text= get_post_meta($post, \'my_custom_meta\' , true );
wp_editor( htmlspecialchars_decode($text), \'mettaabox_ID\', $settings = array(\'textarea_name\'=>\'inputName\') );
}
add_action( \'save_post\', function($post_id) {
if (!empty($_POST[\'inputName\'])) {
$data=htmlspecialchars($_POST[\'inputName\']);
update_post_meta($post_id, \'my_custom_meta\', $datta );
}
});
<小时>Consider This...
我不经常推荐插件,但我强烈建议使用Advanced Custom Fields 像这样的东西。它很容易学习,将节省你的时间和沮丧!您可以快速制作专业管理布局。您应该分配textarea_name 并且编辑器ID不应包含破折号(-)和下划线(\\u1)以外的其他符号。
wp_editor( \'Lorem Ipsum\', \'editor-id\', array(\'textarea_name\'=>\'message\') );
这是我的代谢箱 array( \'id\' => \'all_btns\', \'name\' => \'Button Select\', \'type\' => \'select\', \'options\' => array( \'button\' => \'Button\',