Appearance
Preview Unpublished Content with a Temporary Link
Ask your AI client to create a temporary link to preview a draft, pending, scheduled, or private post, page, or custom post type item. The wp_create_preview_link tool returns a link that shows the item as visitors will see it, without requiring a login.
Create a Preview Link
The WordPress user connected to your AI client needs the edit_posts capability and permission to edit the item. Ask the client to create a preview link for the item, providing:
post_id(required): the ID of the post, page, or custom post type item.expires_in_minutes(optional): how many minutes the link works, from 5 to 1440. The default is 60 minutes.
Link Expiry and Access
Anyone with the link can view the item without signing in until the link expires. The link is signed, but it cannot be revoked early. It stops working if the user who created it loses permission to edit the item. If the item is published, the link redirects to its public page; if it is trashed, it can no longer be previewed.