TODO: To change the header's content go to Dr.Explain menu Options : Project Settings : HTML (CHM) Export : Setup HTML Template and Layout
×
Menu
Index

API

 
API:
Tạo trường form với plugin advanced custom field.
Trường Select.
$def_value = 'item-2';
$data=array(
     'field-1'=> 'Field 1',
     'field-2' => 'Field 2',
     'field-3' => 'Field 3'
);
// create Field HTML
          do_action('acf/create_field', array(
               'type'          =>     'select',
               'name'          =>     'fields[field-1]',        
               'value'          =>     $def_value,
               'layout'     =>     'horizontal',
               'choices'     =>     $data,
          ));
 
radio field:
$key = 'field-1';
do_action('acf/create_field', array(
            'type'      =>   'radio',
            'name'      =>   'fields['.$key.'][preview_size]',
            'value'     =>   $field['preview_size'],
            'layout'    =>   'horizontal',
            'choices'   =>   array(
                'thumbnail' => __('Thumbnail'),
                'something_else' => __('Something Else'),
            )
        ));
Made with help of Dr.Explain

Unregistered version