• Resolved sydneydk

    (@sydneydk)


    Hi, after the last update to version 2.0 two of my custom fields don’t seem to save. I edit the value, hit “Update” and it goes back to empty. When I check the values in phpmyadmin, they are there, but they appear empty both when I try to print them out using:

    $authors = get_post_meta( get_the_ID(), ‘authors’, true );
    foreach( $authors as $author){
    echo $author[‘name’];
    }

    and when I am in the post edit screen. Any thoughts on what could be causing this?

    Note that I have 6 custom fields created. 4 of them work, only two of them have this problem and only after the update to 2.0.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Can you tell me what Field Types are not working correctly? Did you tried to recreate them?

    Did you tried to deactivate all other plugins and use a default WordPress theme? Maybe there is a theme/plugin conflict.

    Also try this:

    $authors = get_post_meta( get_the_ID(), "authors", true );
    foreach( $authors as $author){
        echo $author["name"];
    }

    Looking forward to your reply.

    Best regards,

    Thread Starter sydneydk

    (@sydneydk)

    Hi! Field types: number and text. Although like I said, I have 4 other custom fields (that are also numbers/text) that do work.

    I already have over 200 posts that use these custom fields, so if possible I’d like to avoid recreating them and having to re-enter the values. Using ” in the example code doesn’t seem to make a difference. Like I said, when I’m in the post edit page, the box on the custom field remains empty even after updating the post (although the values show up correctly in phpmyadmin, wp_postmeta in meta_key/meta_value)

    It’s as if, after the update, those values weren’t correctly registered. I can see them all in the database, but they don’t show up in post edit screens or on frontend.

    I did disable theme/plugins.

    Thread Starter sydneydk

    (@sydneydk)

    I might have figured it out. Changelog says: We now save every custom field in it’s own separate post meta with an editable meta_key.

    My custom meta box that doesn’t work has the group name: authors and 2 meta box fields:

    field slug: book-count
    field slug: authors

    I believe the error is because I’m using authors both for field slug AND for meta box group name?

    Hi,

    Yes starting with version 2.0.0 we save every custom field in it’s own separate post meta with an editable meta_key.

    I tested this issue and indeed if I use the same value for the Group Name and Field Slug, custom fields will not save the entry.

    I reported this bug to the dev team and the fix will be available in the upcoming update.

    I am sorry for this inconvenience.

    Best regards,

    Hi,

    Please make a database backup using a plugin like WP-DBManager and then update WCK to the latest version.

    Let me know if everything is working correctly.

    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Custom field value doesn’t save.’ is closed to new replies.