Get menu item slug
Well you’ve Post ID with you. So you can use this custom function to retrieve slug of any post. function get_the_slug( $id=null ){ if( empty($id) ): global $post; if( empty($post) ) return ”; // No global $post var available. $id = $post->ID; endif; $slug = basename( get_permalink($id) ); return $slug; } This in return will … Read more