Php 使用wp_编辑器在前端编辑文章标题

Php 使用wp_编辑器在前端编辑文章标题,php,wordpress,post,frontend,Php,Wordpress,Post,Frontend,我正在尝试添加用户在前端编辑帖子内容的功能 我在每个帖子之后的循环中添加以下代码: <?php $post_id = get_the_ID(); $post = get_post( $post_id, OBJECT, 'edit' ); $content = $post->post_content; $editor_id = 'editpost'; $editor_args = array( 'media_buttons' => false, 'editor_class'

我正在尝试添加用户在前端编辑帖子内容的功能

我在每个帖子之后的循环中添加以下代码:

<?php
$post_id = get_the_ID();
$post = get_post( $post_id, OBJECT, 'edit' );

$content = $post->post_content;
$editor_id = 'editpost';

$editor_args = array(
'media_buttons' => false,
'editor_class' => my_editor,
'textarea_rows' => 10,
'wpautop' => false,
'tinymce' => array( 
'content_css' => get_stylesheet_directory_uri() . '/custom/editor-style_single.css' 
    ) 
);

?>
<div id="inline_editor">
<?php wp_editor( $content, $editor_id, $editor_args ); ?>
</div>

似乎我可以编辑文章内容本身,但我无法管理编辑器来显示文章标题/文章名称


如何从前端编辑文章标题?

要编辑标题,您应该使用$post->post\u title而不是post\u内容,因为post\u内容是页面的主体