If I want to upload content for my users to my website, is it possible to assign a user as a parent of a content? If yes, how?
If it's not possible, how do you suggest I could solve this matter? I want to upload content and assign it to a particular user, so that only they can view it, others can't. If I would create a "Customer" custom post type, I could assign content to them that way, but can I automatically create a Customer with user-data when a user registers?
It rather depends upon who is doing the assigning and when it happens, but basically there are two routes you can go down.
- You can have users registered on your site and then simply assign them to be the post authors of the content. Where are they going to see their content? You can have a "my content" page with a view to display the posts of the currently logged in user, for example.
If you don't want to make the user the post author for some reason, then you can add a custom post field to your content to store the user id, and you will be able to filter your output based upon that field.
- Alternatively, you can, as you say, create a CPT for your users, and have that post be the parent of your content posts. You would then still need to link your users to your user CPT (via authorship or via a custom field), and then create a filter for displaying the content only if the parent post was the same as the logged in user.
As you might surmise from my description, the second route involves an extra intermediary which I'm not sure you need.
Also, when you want to limit who can see the content, I've worked on the assumption you will have something like a "my content" page, but if you want to simply hide content that should not be seen in your normal views, then you will want to add Access into the mix.
Let me know if you can proceed on that basis or if you need any clarification.