update_post_meta not working, but values are true
Question
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'; } }
0
php
3 years
2020-04-05T04:50:50-05:00
2020-04-05T04:50:50-05:00 0 Answers
98 views
0
Leave an answer