Link posts to the auteur
How do you connect a CPT (custom post type) to the author
There are situations where it is desirable for a post to be linked to its author. For example, if multiple people can create posts, such as in a directory, and you want an author to be able to edit only their own posts. With standard WordPress posts, this is automatic. However, this is not the case with a custom post type (CPT). However, linking a custom post type to the author is easy to realize.
You need to know what post type it is
If you don’t, it is easy to find out. If you open a post in the editor, and you look at the URL bar, you will see which post type it is there. This is, for example, one of the posts in our WP tool collection. If you look at the URL, you can see that ‘WP tool’ is the custom post type.
https://wpnews.nl/wp-tool/kadence-blocks/
Add some code to your website
The PHP code below must be added to your theme.
function add_author_support_to_posts() {
add_post_type_support( 'wp-tool', 'author' );
}
add_action( 'init', 'add_author_support_to_posts' );
The seasoned WordPress developer knows exactly how to add this to, for example, a child theme. Today, however, there are much easier ways to do this. You can add the code through every Snippets Manager. We use WP ASE for that.
Check support for authors
Don’t forget to check “support for authors” with the CPT. Whatever plug-in you use to create a custom post, there is always the option to check authors.
The Author is now at the bottom of every custom post
Every custom post of this type now contains at the bottom the link to the author (see the illustration at author). From this moment on, that link is automatically when creating a post. You can also assign the mail to another author.

If the author is limited to editing only their own posts.
It is essential for users to have a specific user role that allows them to edit only their own posts. Additionally, you can modify an existing user role using an appropriate plugin to meet your needs.
