I am trying to enter a formatted chunk of code as a custom field but it never makes it to the database

I am trying to pass this into a custom field called “_vtprd_includeOrExclude”

a:2:{s:23:"includeOrExclude_option";s:11:"includeList";s:29:"includeOrExclude_checked_list";a:2:{i:0;s:2:"1856";i:1;s:4:"1857";}}

enter image description here

Read More

I am using WPAllImport to get the data out of an XML package and into the field.

I know that the function works because if I put “bob” in the custom field it goes in without any issue.

What is wrong with this string that is causing it to come up empty?

enter image description here

As always, your feedback and help is greatly appreciated.

Related posts

1 comment

  1. The problem was that the data within the string would fail if turned into an array because the string count was incorrect for one of the fields.

    The part to look at is at the end.
    … a:2:{i:0;s:2:”1856″;i:1;s:4:”1857″;}}

    The offender is i:0;s:2:”1856″
    “1856” is 4 string characters long, not to.

    So it SHOULD look like this.
    i:0;s:4:”1856″

    When I made that change I silenced the custom function and it worked just fine.
    Perfect example of not knowing enough about how this structure works. So I guess knowing is half the battle.

    go joe.

Comments are closed.