• Resolved Jonas_

    (@jonas_)


    Hi,

    i’m adding custom meta data to a post..

    But strangely when i set the unique value boolean to true.. it doesn’t add them all.. is that because it will look for all values in the postmeta table and not only the values of the post???

    Even if i set it to false.. not all values seems to be added…
    I’m doing like 12 post_meta_data at once.. and yes the values are set because i print them out!!! but for some reason not all are added…

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jonas_

    (@jonas_)

    AND the strange this i echo the add_meta_post also and they ALL return 1.. which means they are succesfull.. however it doesn’t seem that are all succesfull… I checked my error_log also nothing exceptional….

    REMEMBER I SET THE UNIQUE BOOLEAN TO FALSE!

    Now i see in my database they are actually added! BUT there are also the same fields but they are empty!! So i somehow get duplicates where one is valid and the other is not…

    Please help!

    Thread Starter Jonas_

    (@jonas_)

    Ok so it seems that wp_insert_post calls save_post.. i though it was only when they update.. So that was my problem as i was calling update_post_meta(…, $_post[]) .. which was empty of course

    Solved!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_post_meta .. unique values’ is closed to new replies.