Add custom fields to the menu items.
wpify_custom_fields()->create_menu_item_options(
array(
'id' => 'test_menu_item_options',
'title' => 'Test Menu Item Options',
'tabs' => array(
'awesome' => 'Awesome Tab',
),
'items' => array(
'example_text' => array(
'type' => 'text',
'label' => 'Example text',
'required' => true,
'tab' => 'awesome',
),
'use_gallery' => array(
'type' => 'toggle',
'label' => 'Use gallery',
'title' => 'Show the gallery on the page',
'position' => 'inspector'
),
'gallery' => array(
'type' => 'multi_attachment',
'label' => 'Gallery',
'tab' => 'awesome',
'conditions' => array(
array( 'field' => 'use_gallery', 'value' => true ),
),
),
'inner_blocks' => array(
'type' => 'inner_blocks',
'label' => 'Inner Blocks',
'description' => 'Inner Blocks description',
'tab' => 'special',
),
),
),
);Read more about arguments and it's values in WordPress documentation for register_block_type.
Implementation ID.
Title of the meta box.
Tabs used for the custom fields. See Tabs for more information.
List of the fields to be shown. See Field Types for available field types.
Meta key used to store the custom fields values. If meta key is not set, the individual fields will be stored as separate meta values.
