Hi @robthirlby,
Thanks for using Custom Option Plus and for your issue.
The idea of get_customs()
is to have the same key for each value of your array.
Example:

So you can read with:
<?php $users = get_customs('users'); ?>
However, if you’d like to import from another resource or just set as a single item, you can use json and, you can read with get_custom
and json_decode
, like so:

JSON Example:
{"users": [{"firstname": "Leo", "lastname": "Caseiro"}, {"firstname": "Matt", "lastname": "Mullenweg"}, {"firstname": "Rob", "lastname": "Thirlby"}]}
`
Note: On my example, my key is list
To get, use json_decode()
;
<?php
$list = json_decode(get_custom('list'));
print_r($list->users);
?>
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.
-
This reply was modified 8 years, 3 months ago by
Leo Caseiro.