| 开发者 |
palasthotel
edwardbock janaeggebrecht |
|---|---|
| 更新时间 | 2026年8月5日 20:13 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0.2 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
content_relations field, so a headless front end can read them too. Relations to unpublished posts are hidden from anyone who cannot edit posts.
A WP_Query extension lets a query filter by relation: give it a related post id and, optionally, a relation type, and it returns the posts related to it.
/wp-content/plugins/.Add the Related content block (in the inserter, under the same category as the Query Loop block) to a post, and pick a relation type in its settings panel. It lists that post's related posts of that type, in the order you set in the sidebar or meta box.
Every post's REST response carries a content_relations field with its relations. In PHP, content_relations_get_relations_by_post_id( $post_id ) returns the same data.
No. On the REST API they are filtered out for anyone who cannot edit posts, and the editor's search only offers posts the current user may read.