lib/MenuItem.php
public function slug() {
		$mo = $this->master_object();
		if ( $mo && $mo->post_name ) {
			return $mo->post_name;
		}
		return $this->post_name;
	}
public function slug() {
		$mo = $this->master_object();
		if ( $mo && $mo->post_name ) {
			return $mo->post_name;
		}
		return $this->post_name;
	}
public function slug ( ) { $ mo = $ this -> master_object ( ) ; if ( $ mo && $ mo -> post_name ) { return $ mo -> post_name ; } return $ this -> post_name ; }
Get the slug for the menu item.

@api
@example
```twig
<ul>
{% for item in menu.items %}
<li class="{{ item.slug }}">
<a href="{{ item.link }}">{{ item.name }}</a>
</li>
{% endfor %}
</ul>
```
@return string The URL-safe slug of the menu item.
Get the slug for the menu item .