Custom Fields – Add to array
-
Greetings.
Having the documentation on custom fieldshttps://wpadverts.com/documentation/custom-fields/
I have the following question.If in the functions php the field gets added with this parameter:
$form["field"][] = array( "name" => "condition", "type" => "adverts_field_select", "order" => 29, "label" => "Condition", "is_required" => true, "validator" => array( array( "name" => "is_required" ), ), "options" => array( array("value"=>"New","text"=>"New"), array("value"=>"Used","text"=>"Used"), ) );
How can i add a second item into the resulting array?
Let me clarify:
The result field comes into the form as array into the meta of the post with one item into the array.
'condition => 0 => "New"
The idea is add into the array a secondary key so i can use it to call such value in the meta to seize the field and extend an additional information piece like thisarray meta comes 'condition'=> 0 =>"New", 1=>"star"
Am i missing something, or such meta does nnot allow secondary items on such arrays?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom Fields – Add to array’ is closed to new replies.