WordPress.org

Support

Support » Plugins and Hacks » Live Drafts » Serialised custom meta gets "corrupted"

Serialised custom meta gets "corrupted"

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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

    Tim

    @timwakeling-1

    Thanks very much – needed this fix!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Serialised custom meta gets "corrupted"’ is closed to new replies.
Skip to toolbar