WPDev.one
Core Function
View Source on Trac ↗

rest_get_route_for_post()

rest_get_route_for_post( mixed $post )

Gets the REST API route for a post.

Parameters 1 required

Name / Type Description
(int

| WP_Post) $post Post ID or post object.

Required

Return Value

(string)
string The route path with a leading slash for the given post, or an empty string if there is not a route.

Function Information

Since Version
5.5.0
Source File
wp-includes/rest-api.php
Advertisement