title: How do I fix an 'Undefined array key' warning in a custom post type
body: <p>I have just upgraded to php8 and my error log has a lot of warnings about an undefined array key in code that sets up a custom post type.</p>
  <p>A snippet from this CPT code is:</p>
  <pre><code>function create_custom( $cpt = array() ) {
  register_post_type($cpt['post_type'], array(
      'label'                     =&gt; __($cpt['label'], 'kbo'),
      'description'               =&gt; __($cpt['description'], 'kbo'),
      'public'                    =&gt; true,
      'show_ui'                   =&gt; true,
      'show_in_menu'              =&gt; $cpt['show_in_menu'],
      'capability_type'           =&gt; 'post',
  </code></pre>
  <p>The line causing the warning is 'show_in_menu'</p>
  <p>How can I define this so that the warning stops?</p>