htmlburger / carbon-fields

WordPress Custom Fields Library ✨
https://carbonfields.net/
Other
1.38k stars 245 forks source link

nav_menu_item container wont show till after saving a menu item to menu #709

Open Brayn7 opened 5 years ago

Brayn7 commented 5 years ago

Version

3.0

Expected Behavior

I add just a basic nav_menu_item container with a field. Copied from example. I go to menus and click add to menu and I expect the fields to be there.

Actual Behavior

The actual fields do show but only if i add a menu item then save then open the menu item back up.

Container definition


// functions.php
use Carbon_Fields\Container;
use Carbon_Fields\Field;

add_action( 'after_setup_theme', 'crb_load' );
function crb_load() {
    \Carbon_Fields\Carbon_Fields::boot();
}
add_action( 'carbon_fields_register_fields', 'test' );
function test (){
Container::make( 'nav_menu_item', 'Menu Settings' )
    ->add_fields( array(
        Field::make( 'color', 'crb_color' ),
    ));

}
chrismccoy commented 3 months ago

any update on this, seems to be an important thing to fix?