-
Notifications
You must be signed in to change notification settings - Fork 87
Paragraph field
plovs edited this page Jan 1, 2013
·
2 revisions
#Paragraph Field
To add an input field to your metabox simply use the addParagraph method of the metabox object:
$my_meta = new AT_Meta_Box($config);
$my_meta->addParagraph('paragraph_field_id',array('value'=> __("This is a simple paragraph","apc")));
- ID : field id (string)
- args: (mixed|array)
-
'value' => paragraph html, will be wrapped in <p></p> tags
-
- reapeater: When adding this field to a repeater block set to true (default false)
$saved_data = get_post_meta($post->ID,'paragraph_field_id',true);
echo $saved_data;
###Arbitrary html
Any html can be added to your meta-box using addParagraph, for example, to add a button:
$my_meta->addParagraph('button_id',array('value'=> '<input type="submit" name="publish" id="publish" class="button button-primary button-large" value="Publish" accesskey="p">'));