Set the checkbox as checked by default in menu item page

You can check if the $item->menuitemlayouts has value if not set checked for the first one…

<?php echo $item->menuitemlayouts ? checked($item->menuitemlayouts, 'itemwithouticon', true) : 'checked="checked"'; ?>

In the checked() I added the 3rd arg so it won’t echo twice..

<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemwithouticon" <?php echo $item->menuitemlayouts ? checked($item->menuitemlayouts, 'itemwithouticon', true) : 'checked="checked"'; ?> />
<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemwithicon" <?php checked($item->menuitemlayouts, 'itemwithicon'); ?> />
<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemicon" <?php checked($item->menuitemlayouts, 'itemicon'); ?> />

Or alternative just set a variable for this with default value if its not set.

<?php
$menuitemlayouts = $item->menuitemlayouts ? $item->menuitemlayouts : 'itemwithouticon';
?>
<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemwithouticon" <?php checked($menuitemlayouts, 'itemwithouticon'); ?> />
<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemwithicon" <?php checked($menuitemlayouts, 'itemwithicon'); ?> />
<input type="radio" name="menu-item-menuitemlayouts[<?php echo $item_id; ?>]" value="itemicon" <?php checked($menuitemlayouts, 'itemicon'); ?> />

tech