我尝试插入wp_editor。一切都很好,但保存内容后内容不会显示。
function display_slogan_element() {
$editor_id = "home_slogan";
$editor_class = "slogan";
$textarea_name = "slogan";
$content = get_post_meta( $post->ID, 'slogan', true);
$settings = array('teeny'=> TRUE);
wp_editor( $content, $editor_id, $settings = array() );
}
我不确定是什么问题。有人可以帮帮我吗?
答案 0 :(得分:0)
请检查后定义global $post;
吗?
例如:
function display_slogan_element() {
global $post;
$editor_id = "home_slogan";
$editor_class = "slogan";
$textarea_name = "slogan";
$content = get_post_meta( $post->ID, 'slogan', true);
$settings = array('teeny'=> TRUE);
wp_editor( $content, $editor_id, $settings = array() );
}