Changes

→‎Modifying extra options: Changed extra from object to associative array
Line 165: Line 165:  
$fields = fetchAllFieldsStruct();
 
$fields = fetchAllFieldsStruct();
   −
$fields->mycustomfield->extra->newproperty = 'This is a new property'; // add a new property over the old extra options sub-object
+
$fields->mycustomfield->extra['newproperty'] = 'This is a new property'; // add a new property over the old extra options sub-object
 +
$fields->mycustomfield->extra['mycategory'] = 'Overwrite the old category'; // this will replace the previous value of 'mycategory' extra option
    
$customfields->setExtra('mycustomfield', $fields->mycustomfield->extra); // store the modified extra options back into the database for future usage
 
$customfields->setExtra('mycustomfield', $fields->mycustomfield->extra); // store the modified extra options back into the database for future usage
439

edits