Text
<?php
$tea_content = array(
array(
'type' => 'text',
'title' => 'What do you like?',
'id' => 'my_text_field_id',
'default' => "Penguins, I am sure they're gonna dominate the World!",
'placeholder' => "McDonald's as well",
'description' => 'Put in here everything you want.',
'maxlength' => 120,
),
);
Or if you need to add some details...
<?php
$tea_content = array(
array(
'type' => 'text',
'title' => 'How much do you like Penguins?',
'id' => 'my_text_field_id',
'default' => 100,
'placeholder' => '50',
'description' => 'Tell us how much do like Penguins to have a chance to get into our private Penguins community ;)',
'options' => array(
'type' => 'number',
'min' => 10,
'max' => 100,
'step' => 1,
),
),
);
Retrieve data
Using the _get_option('my_text_field_id')
method, you'll get (with a json_encode()
display):
"Penguins, I am sure they're gonna dominate the World!"
Updated less than a minute ago