php - update_post_meta not working, but values are true

I want to update posts in frontend in my Wordpress site. BUt update_post_meta doesnt work, I tested datas with echo, but

I want to update posts in frontend in my Wordpress site. BUt update_post_meta doesnt work, I tested datas with echo, but they are working very well.

if(isset($_POST['save_button'])) {

    if (empty($_POST['title'])) {

        echo 'Error';

    } else {

        $post_id = $_POST['post_id'];

        update_post_meta($post_id,'post_title', $_POST['title']);

        echo $post_id; // works good;
        echo $_POST['title']; //works good;

        echo 'Saved';

    }

}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744595753a4582880.html

相关推荐

  • php - update_post_meta not working, but values are true

    I want to update posts in frontend in my Wordpress site. BUt update_post_meta doesnt work, I tested datas with echo, but

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信