Support » Fixing WordPress » get_post_meta in {status}_{post_type} Hook

Viewing 1 replies (of 1 total)
  • I don’t know if this is the best solution or not, but I have the post meta updated by putting update_post_meta() before the variables with get_post_meta are defined like this.

    update_post_meta($ID,'task-assignment',$_POST['task-assignment']);
    update_post_meta($ID,'task-due-date',$_POST['task-due-date']);

    If I’m looking at it correctly, this makes the post meta get updated with the last inputs before clicking Publish or Update. Then when the variables are defined with get_post_meta, they are using the most recent values for the post meta.

    If anyone sees anything wrong with this, or knows of a better way please let me know.

Viewing 1 replies (of 1 total)
  • The topic ‘get_post_meta in {status}_{post_type} Hook’ is closed to new replies.