get menu id using its name

I have a menu name Social Network. I want to get the menus ID. I tried the following, but didn’t succeed. global $wpdb; $menu_slug = ‘social-network’; $menu_id = $wpdb->get_results( ” SELECT TERM_ID FROM $wpdb->wp_terms WHERE name = “.$menu_slug.” ” ); echo $menu_id; 4 Answers 4 You can use the function get_term_by and use ‘name’ in … Read more

Get Post ID with insert/edit link

Hi I want to get the post ID from the post selected in the insert/edit link button. I would normally do: <a data-id=”<?php echo $post->ID; ?>” href=”https://wordpress.stackexchange.com/questions/256062/<?php the_permalink();?>”> Sample page link </a> But whenever the user adds the links from the tinymce content editor all they get is the permalink, I don’t know how to … Read more