I am working on a wordpress site and I need to assign the value of a function to a value inside an array but it keeps giving me errors. In the customFields array I need to insert the value of the get_option('contact_email', 'no one') into some helper text. In the code snippet below I need to replace {CONTACT_EMAIL} with the get_option value but can't figure it out.
...
var $customFields = array(
array(
"name" => "ContactPerson-name",
"title" => "Contact Name",
"description" => "Enter the first and last name of the page contact. If left blank, the site default of {CONTACT_PERSON} will be used.",
"type" => "textinput",
"scope" => array( "page" ),
"capability" => "edit_pages"
),
array(
"name" => "ContactPerson-email",
"title" => "Contact Email",
"description" => "Enter the email address of the page contact. If left blank, the site default of {CONTACT_EMAIL} will be used.",
"type" => "textinput",
"scope" => array( "page" ),
"capability" => "edit_pages"
),
array(
"name" => "ContactPerson-phone",
"title" => "Contact Phone (XXX) XXX-XXXX",
"description" => "Enter the phone number of the page contact. If left blank, the site default of {CONTACT_PHONE} will be used.",
"type" => "textinput",
"scope" => array( "page" ),
"capability" => "edit_pages"
),
array(
"name" => "ContactPerson-address",
"title" => "Contact Room Number & Building",
"description" => "Enter the room number and building of the page contact. Click <a href=\"http://www.engin.umich.edu/buildingabbreviations\">here</a> for building abbreviations. If left blank, the site default of {CONTACT_ADDRESS} will be used.",
"type" => "textinput",
"scope" => array( "page" ),
"capability" => "edit_pages"
),
...
...
I've tried to close the text and concat the function, I've tried to do a string replace and nothing seems to work. Thanks for any help anyone can provide.
implodeand store it onCONTACT_EMAILvariable