save_acpt_meta_field

save_acpt_meta_field

Create/edit a form meta field.

Usage

save_acpt_meta_field([
   'group_name' => 'group',
   'box_name' => 'box',
   'name' => 'field',
   'label' => 'field',
   'type' => 'text',
   'show_in_archive' => false,
   'is_required' => false,
   'default_value' => "foo",
   'description' => "lorem ipsum dolor facium",
   'advanced_options' => [
	[
		'value' => '</p>',
		'key' => 'after',
	],
	[
		'value' => '<p>',
		'key' => 'before',
	],
	[
		'value' => '平仮名',
		'key' => 'label',
	],
    ]
]);

Parameters

  • group_name (string) (Required) The group name

  • box_name (string) (Required) The box name

  • name (string) (Required) The field name

  • new_name (string) (Optional) The new field name, if you are modifying an already saved field

  • label (string) (Optional) The field label

  • type (string) (Required) The field type

  • show_in_archive (boolean) (Optional) Show the field in the admin list

  • is_required (boolean) (Optional) The field is required

  • quick_edit (boolean) (Optional) Enable quick edit in the admin list

  • filterable_in_admin (boolean) (Optional) Make the field filterable in the admin list

  • default_value (string) (Optional) The field default value

  • description (string) (Optional) The field description

  • options (array) (Optional) The options array (only for Select, Select Multi, Checkbox, and Radio fields)

  • validation_rules (array) (Optional) The validation rules array

  • visibility_conditions (array) (Optional) The advanced options array

  • relations (array) (Optional) The relations array (only for Relational fields)

  • advanced_options (array) (Optional) The advanced options array

  • children (array) (Optional) The array of fields children (only for Repeater fields)

  • blocks (array) (Optional) The array of nested blocks (only for Flexible fields)

Return

  • boolean

Last updated