thebatclaudio / wp-rest-api-v2-menus

Adding menus endpoints on WP REST API v2
47 stars 22 forks source link

Use post_name instead of basename (Bugfix for static home page) #38

Closed FloLech closed 3 years ago

FloLech commented 3 years ago

Fixes Bug when setting a static front-page.

Context on localhost: When setting a static frontpage basename( get_sl($item->object_id) ) returns "localhost". Using et_post_field( 'post_name', $item->object_id ) returns the actual slug of the page.