carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

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

Open Brayn7 opened this issue 6 years ago • 1 comments

Version

3.0

  • Carbon Fields:
  • WordPress:
  • PHP:

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' ),
    ));

}

Brayn7 avatar Apr 30 '19 13:04 Brayn7

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

chrismccoy avatar Jul 19 '24 14:07 chrismccoy