title: How to get the menu id on href click in a page wordpress
body: <p>i want the menu id on href click in wordpress because i'm using the menu id dynamically to list the submenus as childrens</p>
  
  <pre><code>&lt;?php 
  $menu=$wpdb-&gt;get_var( 'SELECT post_id FROM '.$wpdb-&gt;postmeta.' WHERE meta_key="_menu_item_object_id" AND meta_value="'.$post_id.'"' );
  $args = array(
  'menu'    =&gt; 'main',
  'submenu' =&gt; (string) $menu
  );
  
  wp_nav_menu( $args ); ?&gt;
  </code></pre>