Basic usage:
Use the following code to create textarea field:
1 2 3 4 5 6 7 8 |
$xbox->add_field(array( 'id' => 'custom-textarea', 'name' => __( 'Custom Textarea', 'textdomain' ), 'type' => 'textarea', 'default' => 'Textarea content', )); |
Result:
Advanced usage, with available options:
No options available.
Getting saved value:
1 2 3 4 5 6 7 8 |
$xbox = Xbox::get( 'metabox-id' ); $value = $xbox->get_field_value( 'custom-textarea' ); var_dump($value); //Return string(16) "Textarea content" |