我尝试插入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() );
}
我不确定问题出在哪里。有人能帮我吗?
您能在检查后定义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() );
}