Linux 软件免费装

Content Relations

开发者 palasthotel
edwardbock
janaeggebrecht
更新时间 2026年10月2日 20:29
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1.2
版权: GPL-3.0-or-later
版权网址: 版权信息

标签

post gutenberg rest related relation

下载

1.0.2 1.0.5 1.0.6 1.0.7 1.0.15 1.0.14 1.0 1.0.12 1.0.16 1.0.3 1.0.4 1.1.0 1.1.1

详情介绍:

Content Relations lets you link a post to any other post. Relations are typed - you name the kind of relation ("see also", "part of", whatever fits) - and ordered by dragging. In the block editor, a Content Relations panel in the document sidebar edits a post's relations the same way you'd edit categories: grouped by type, saved with the rest of the post, no separate save button. The classic editor keeps the same editor in a meta box instead. A Related content block - a variation of the core Query Loop block - lists a post's own related posts under one relation type, in the order you set in the sidebar, meta box, or the Tools screen. Drop it in wherever a "related articles" section belongs; it uses the same layout options as any other Query Loop. Tools → Content Relations lists every relation type in a sortable, searchable table. Opening a type there lets you reorder or remove its relations across every post that uses it, grouped by source post, with drag handles or up/down buttons. Each related post's relations are exposed on the REST API under a 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.

安装:

  1. Install the plugin through Plugins → Add New, or upload it to /wp-content/plugins/.
  2. Activate it through the Plugins menu.
  3. A Content Relations panel appears in the block editor's document sidebar (a meta box in the classic editor), and a settings page under Tools → Content Relations lists the relation types.

常见问题:

How do I show related posts on the front end?

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.

How do I read relations on the front end myself?

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.

Are relations to drafts or private posts visible?

Only to someone who may read them. On the REST API a relation appears only if the current user may read both posts, so visitors see relations between published posts. The editor's search only offers posts the current user may read, and a relation can only be added to such a post.

更新日志:

1.1.1 Bug Fixes 1.1.0 Features 1.0.16 Bug Fixes 1.0.15 1.0.14 1.0.13 1.0.12 1.0.11 1.0.10 1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0