public function registerFields($id, $item, $depth, $args)
    {
        foreach ($this->fields as $_key => $data) :
            $key = sprintf('menu-item-%s', $_key);
            $id = sprintf('edit-%s-%s', $key, $item->ID);
            $name = sprintf('%s[%s]', $key, $item->ID);
            $value = get_post_meta($item->ID, $key, true);
            $class = sprintf('field-%s', $_key);
            ?>
            <p class="description description-wide <?php echo esc_attr($class) ?>">
                <?php if ($data["type"] == "bool"): ?>
                    <label>
                        <?= esc_html($data["name"]) ?><br/>
                        <select id="<?= esc_attr($id) ?>" class="widefat <?= esc_attr($id) ?>" name="<?= esc_attr($name) ?>">
                            <option value="0" <?= $value !== 1 ? " selected" : "" ?>><?= __("No", "theme") ?></option>
                            <option value="1" <?= $value == 1 ? " selected" : "" ?>><?= __("Yes", "theme") ?></option>
                        </select>
                    </label>
                <?php else: ?>
                    <label>
                        <?= esc_html($data["name"]) ?><br/>
                        <input type="text" id="<?= esc_attr($id) ?>" class="widefat <?= esc_attr($id) ?>" name="<?= esc_attr($name) ?>" value="<?= esc_attr($value) ?>"/>
                    </label>
                <?php endif; ?>
            </p>
            <?php
        endforeach;
    }
public function registerFields($id, $item, $depth, $args)
    {
        foreach ($this->fields as $_key => $data) :
            $key = sprintf('menu-item-%s', $_key);
            $id = sprintf('edit-%s-%s', $key, $item->ID);
            $name = sprintf('%s[%s]', $key, $item->ID);
            $value = get_post_meta($item->ID, $key, true);
            $class = sprintf('field-%s', $_key);
            ?>
            <p class="description description-wide <?php echo esc_attr($class) ?>">
                <?php if ($data["type"] == "bool"): ?>
                    <label>
                        <?= esc_html($data["name"]) ?><br/>
                        <select id="<?= esc_attr($id) ?>" class="widefat <?= esc_attr($id) ?>" name="<?= esc_attr($name) ?>">
                            <option value="0" <?= $value !== 1 ? " selected" : "" ?>><?= __("No", "theme") ?></option>
                            <option value="1" <?= $value == 1 ? " selected" : "" ?>><?= __("Yes", "theme") ?></option>
                        </select>
                    </label>
                <?php else: ?>
                    <label>
                        <?= esc_html($data["name"]) ?><br/>
                        <input type="text" id="<?= esc_attr($id) ?>" class="widefat <?= esc_attr($id) ?>" name="<?= esc_attr($name) ?>" value="<?= esc_attr($value) ?>"/>
                    </label>
                <?php endif; ?>
            </p>
            <?php
        endforeach;
    }
public function registerFields ( $ id , $ item , $ depth , $ args ) { foreach ( $ this -> fields as $ _key => $ data ) : $ key = sprintf ( 'menu-item-%s' , $ _key ) ; $ id = sprintf ( 'edit-%s-%s' , $ key , $ item -> ID ) ; $ name = sprintf ( '%s[%s]' , $ key , $ item -> ID ) ; $ value = get_post_meta ( $ item -> ID , $ key , true ) ; $ class = sprintf ( 'field-%s' , $ _key ) ; ?>
            <p class="description description-wide <?php echo esc_attr ( $ class ) ?>">
                <?php if ( $ data [ "type" ] == "bool" ) : ?>
                    <label>
                        <?= esc_html ( $ data [ "name" ] ) ?><br/>
                        <select id="<?= esc_attr ( $ id ) ?>" class="widefat <?= esc_attr ( $ id ) ?>" name="<?= esc_attr ( $ name ) ?>">
                            <option value="0" <?= $ value !== 1 ? " selected" : "" ?>><?= __ ( "No" , "theme" ) ?></option>
                            <option value="1" <?= $ value == 1 ? " selected" : "" ?>><?= __ ( "Yes" , "theme" ) ?></option>
                        </select>
                    </label>
                <?php else : ?>
                    <label>
                        <?= esc_html ( $ data [ "name" ] ) ?><br/>
                        <input type="text" id="<?= esc_attr ( $ id ) ?>" class="widefat <?= esc_attr ( $ id ) ?>" name="<?= esc_attr ( $ name ) ?>" value="<?= esc_attr ( $ value ) ?>"/>
                    </label>
                <?php endif ; ?>
            </p>
            <?php endforeach ; }
Register fields for menu item required for mega menu

@param $id
@param $item
@param $depth
@param $args
Register fields for menu item required for mega menu