| 开发者 | dshanske |
|---|---|
| 更新时间 | 2026年10月11日 04:35 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
Kinds, like Post Formats built into WordPress, allow you to specify that a post contains a certain type of content. It also, based on you classifying it that way, displays it appropriately and marks it up accordingly so outside sites can identify it. Kinds are either a response to something, such as a URL, or a more passive type of post where you are recording/logging something you did, for example, watched a movie. When you write a post in the Classic Editor, choose its kind in the Kind box. For kinds that respond to something, fill in the Response Properties box:
This is added by webmention support.
For more information on the Indieweb and tools for WordPress, visit Getting Started on WordPress.
You can enable/disable more based on preference. Some may be enabled by plugins. You do not have to use ones you don't want. Not having a post kind enabled will not disable the functionality on existing posts, it only hides the selection in adding new posts.
These kinds have an analog in post formats. Adding context to one of these may make it a Passive Kind.
The following Kinds are reserved for future use but will not show up in the interface at this time.
I would prefer if something is popular enough to merge it into the plugin. Feel free to ask for a term to be reserved by filing an issue.
However if you are interested in creating your own there is functionality around it.
register_post_kind(
'reply',
array(
'singular_name' => ( 'Reply', 'indieweb-post-kinds' ), // Name for one instance of the kind.
'name' => ( 'Replies', 'indieweb-post-kinds' ), // General name for the kind, plural.
'verb' => ( 'Replied to', 'indieweb-post-kinds' ), // The verb or action, such as "Liked".
'property' => 'in-reply-to', // Microformats 2 property.
'format' => 'link', // Post format that maps to this kind.
'description' => ( 'a reply to content typically on another site', 'indieweb-post-kinds' ),
'description_url' => 'http://indieweb.org/reply',
'title' => false, // Whether this kind should have an explicit title.
'show' => true, // Whether to show the kind in Settings.
)
);
Call it from a function hooked to init and it will add the Kind to the system. The developer notes list the other arguments.
set_post_kind_visibility( $slug, $show = true ) - If you add this function in early on, it will change the visibility of a kind.
Post Kinds automatically handles the display of archives of individual types. So to view all the posts marked as "note", for example, one could visit the URL http://www.YOURSITE.COM/kind/note/.
Simply replace YOURSITE.COM with your particular site name and the particular post kind name to access the others.
To use another word than "kind" in these URLs, for example in your own language, set the Kind base on Settings > Permalinks. Links to the old URLs then stop working, as when the category base changes.
You can also add the date /kind/note/2018/12/24 to see date-based archives.
To leave specific kinds out of an archive, use ?exclude=kind&exclude_terms=note or /exclude/kind/note,checkin, which accepts several kinds.
There is also a special photo archive, using ?kind_photos=1 or /photos or /photos/yyyy or /photos/yyyy/mm or /photos/kind/note or any other taxonomy. This will use the photo enhancements introduced in 3.4.0 to only show photos from
all types of posts.
Post Kinds also automatically handles RSS feeds which can be made available or subscribed to for any of the particular kinds. The RSS feed for all the posts marked as "note", for example could be found at either the URL http://www.example.com/kind/note/feed or http://www.example.com/feed/?kind=note (if one doesn't have pretty permalinks enabled). Others can be obtained by replacing "note" with the other kinds.
At the moment, a fully automatic bookmarklet is not yet part of the plugin but you can send data directly to the Post Editor
?kindurl=URL to the post editor URL, it will automatically fill this into the URL box in post properties?kind=like to the post editor URL, it will automatically set the kind.https://www.example.com/wp-admin/post-new.php?kindurl=URL&kind=like will automatically set a like with the URL
Using the Micropub plugin for WordPress is the easiest way to post outside of the Post Editor. This will work with any Micropub client.
The JetPack sharing module conflicts with this plugin.
I am not sure. It is not a strict priority. At this time, there is no definite time for this support. I have been gradually moving toward abstracting more of the data into the REST API so it could more easily be added to the block editor.
The Development version of the plugin is hosted at Github. You can file issues there.
kind field in the REST API now has a description and lists the valid kinds; an unknown kind is rejected with rest_invalid_param.svg-icon { width: 1rem; height: 1rem; }. The inline style is gone, the plugin's styles have no specificity, and icons have a default size where the stylesheet doesn't load, such as feed readerskind in kind archive URLs such as /kind/like/, and the kind_base_slug filtercalculate_duration() now also accepts date objectswp post-kinds upgrade runs it on demand (--dry-run, --post=<id>)display_formatted_datetime(), divide_datetime(), build_datetime(), get_datetime_offset(), divide_interval() and build_interval(). Use the Kind_Time methods of the same names. The global names still work but report a deprecation notice when debugging is on, and they will be removed in the next major release (5.0.0). Custom views copied into a theme may call them, so update those to the Kind_Time methods.kind_views folder keep their old code. Copy them again from the plugin's views folder, or escape their output.p-summary instead of e-summary. Kind_View::get_summary() returns the summary markup.Kind_View::get_hcard(), get_cite_title(), get_site_name(), get_embed(), get_url_link() and display_duration() return escaped markup; HTML passed as a name is shown as text.kind_get_the_title() escapes the content before the kind_get_the_title_content filter.Kind_View::rsvp_text() takes optional URL and name arguments and returns the full sentence. Called with only a type, it still returns a printf-ready string. The RSVP strings have changed, so translations need updating.Kind_View::rating_text() ignores non-numeric ratings and shows at most 10 stars.wp post-kinds upgrade finishes it at once.kind_photo_shortcode_exclude filter, which never ran.MF2_Post::get_images() no longer imports remote photos into the media library; it returns media library attachments only.MF2_Post class. Use Kind_Post. Creating an MF2_Post reports a deprecation notice when debugging is on; the class will be removed in a future major version.onthisday and photos slug to be customizedchange_kind hook that triggers when a the kind on a post is changedkind-type css class only to posts