Code
<?php
$tea_content = array(
array(
'type' => 'Code',
'title' => 'How do Penguins code their icebergs?',
'id' => 'my_code_field_id',
'default' => 'With a frozen bug.',
'rows' => 4,
'description' => 'A simple question to know if you know how to seduce a penguin.',
),
);
NB: a big thanks to readme.io for the design inspiration :)
Retrieve data
Using the _get_option('my_code_field_id')
method, you'll get (with a json_encode()
display):
{
"mode": "text\/javascript",
"code": "\/**\r\n * TEA CODE FIELD\r\n *\r\n *\r\n * To add this field, simply make the same as follow:\r\n * array(\r\n * 'type' => 'Code',\r\n * 'title' => 'How do Penguins code their icebergs?',\r\n * 'id' => 'my_code_field_id',\r\n * 'std' => 'With a frozen bug.',\r\n * 'rows' => 4,\r\n * 'description' => 'A simple question to know if you know how to seduce a penguin.'\r\n * )\r\n *\/\r\nvar tea = 'Here it comes';"
}
Updated less than a minute ago