[wp-trac] [WordPress Trac] #37534: Saving an array with update_post_meta bug

WordPress Trac noreply at wordpress.org
Mon Aug 1 02:17:50 UTC 2016


#37534: Saving an array with update_post_meta bug
--------------------------------+-----------------------------
 Reporter:  Pulsar_Media        |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  4.5.3
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 Hi,

 I came across a rather strange bug using update_post_meta. I noticed it
 after i tried saving a multi-dimensional array.

 Basically what happens is my array was getting wrapped inside of a new
 array each time i saved it to the database using the "update_post_meta"
 function.

 I am guessing this might have something to do with the maybe_serialize
 function that update_post_meta supposedly uses when saving data?

 Anyways, i wanted to bring this to your attention because this bug drove
 me nuts for several days trying to figure out what the hell was going on.

 It was after i manually serialized my array and saved the data that i
 noticed my serialized string was being returned in an array using
 get_post_meta.

 Anyways, im pretty sure this is some kind of bug...please look into this.

 Thanks.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37534>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list