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";}}
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?
As always, your feedback and help is greatly appreciated.
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.