public function init()
 {
     $fm = new Fieldmanager_Checkbox('Basic Checkbox', array('name' => 'basic_checkbox'));
     $fm->add_meta_box('Basic Checkbox Field', 'demo-checkbox');
     $fm = new Fieldmanager_Checkbox('Checked Checkbox', array('name' => 'checkbox_options', 'default_value' => 'checked'));
     $fm->add_meta_box('Checkbox field with options', 'demo-checkbox');
     $fm = new Fieldmanager_Checkboxes('Checkboxes', array('name' => 'checkbox_group', 'options' => array('One', 'Two', 'Three')));
     $fm->add_meta_box('Group of Checkboxes', 'demo-checkbox');
     /*
     $fm = new Fieldmanager_Group( array(
     	'name'           => 'repeatable_checkbox',
     	'limit'          => 0,
     	'add_more_label' => 'Add another field',
     	'sortable'       => true,
     	'label'          => 'Field',
     	'children'       => array(
     		'checkbox_field' => new Fieldmanager_Checkbox( 'Repeatable Field' )
     	)
     ) );
     $fm->add_meta_box( 'Repeatable Checkbox Fields', 'demo-checkbox' );
     */
     $fm = new Fieldmanager_Checkbox('Basic Checkbox', array('name' => 'sidebar_checkbox'));
     $fm->add_meta_box('Sidebar Checkbox Field', 'demo-checkbox', 'side');
     /*
     $fm = new Fieldmanager_Group( array(
     	'name'           => 'sidebar_repeatable_checkbox',
     	'limit'          => 0,
     	'add_more_label' => 'Add another field',
     	'sortable'       => true,
     	'label'          => 'Field',
     	'children'       => array(
     		'checkbox_field' => new Fieldmanager_Checkbox( 'Repeatable Field' )
     	)
     ) );
     $fm->add_meta_box( 'Sidebar Repeatable Checkbox Fields', 'demo-checkbox', 'side' );
     */
 }
Example #2
0
function alfath_page_metabox()
{
    $fm = new Fieldmanager_Checkbox('Show Page title', array('name' => 'alfath_page_title', 'default_value' => 'checked'));
    $fm->add_meta_box(__('Page Options', 'alfath'), array('page'), 'side');
}