• Hey Y’all

    Having an issue in my custom plugin where update_post_meta will create the post_meta value if it’s not present but won’t update it if it already exists.
    This is my code,

    $postid = $post1->ID;
                                 $updateP = update_post_meta( $postid, timeUpdate, $time);

    The only thing I can think of is database permissions but all users have full permissions.

    Thanks in Advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,
    assuming you defined correctly your “$postid”, “$post1id” and “$time” variables, maybe it’s

    $postid = $post1->ID;
    $updateP = update_post_meta( $postid, 'timeUpdate', $time );

    hope it’s just this, cheers!

    Thread Starter jfavelle

    (@jfavelle)

    no, sorry I had it in quotes. Anyone at all!?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘update_post_meta not working’ is closed to new replies.