Leave a Reply

1 comment

  1. update_post_meta uses update_metadata you can find it’s code here in that function if you have a look at line 119 you will see that the meta_value is passed to wp_unslash which return value is a string (the function that changes the data type is stripslashes_deep)

    As a workaround you can serialize the value before passing it to update_post_meta()

    EDIT:
    Found the issue: before 3.6.0 update_metadata had on line 117 this code:

    $meta_key = stripslashes($meta_key)
    

    stripslashes is a php function that returns a string.
    as of 3.6.0 that line looks like:

    $meta_key = wp_unslash($meta_key);
    

    which stripslashes only string type meta_keys.

    An update to wordpress 3.6.0 or above will fix the issue.