开发者 | dshanske |
---|---|
更新时间 | 2024年10月6日 09:26 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.5 |
版权: | 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.
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 string for the verb or action (liked this) 'property' => 'in-reply-to', // microformats 2 property 'format' => 'link', // Post Format that maps to this 'description' => ( 'a reply to content typically on another site', 'indieweb-post-kinds' ), 'description-url' => 'http://indieweb.org/reply', 'title' => false, // Should this kind have an explicit title 'show' => true, // Show in Settings ) ) ); Add a function with your kind in the above format, hooking it in the init hook and it will add the Kind to the system.
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.
You can also add the date /kind/note/2018/12/24 to see date-based archives.
For archives if you add exclude_kind as a query variable it will exclude specific kinds from the query ?exclude=kind&exclude_terms=note
. You can also do this as /exclude/kind/note,checkin as it accepts multiple values
There is also a special photo photo included, 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.
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