WordPress.org

Ready to get started?Download WordPress

Forums

Live Drafts
Serialised custom meta gets "corrupted" (3 posts)

  1. Jay Hewitt
    Member
    Posted 1 year ago #

    Hi,

    When publishing a "Live Draft" our custom data which is serialised get re-serialised by add_post_meta()

    Adding the following before add_post_meta() fixes this issue:

    $mvalueArr = @unserialize($mvalue);
        if($mvalueArr!==false){
        $mvalue = $mvalueArr;
    }
    add_post_meta($newId, $ckey, $mvalue, true);

    Thanks
    J

    http://wordpress.org/extend/plugins/live-drafts/

  2. Jay Hewitt
    Member
    Posted 1 year ago #

    Correction to previous Post:

    try{
        $mvalueArr = unserialize($mvalue);
        if($mvalueArr!==false){
            $mvalue = $mvalueArr;
        }
    } catch (Exception $e){
    
    }
    add_post_meta($newId, $ckey, $mvalue, true);

    Thanks
    J

  3. tim.wakeling
    Member
    Posted 9 months ago #

    Thanks very much - needed this fix!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.