Answer the question
In order to leave comments, you need to log in
How to send files to wordpress users?
It is necessary that in the admin panel you can send files to users by roles.
Let's say there are 10 people with the role of a subscriber, they are shown by a form in the admin panel and they can attach a file (txt pdf). Then the subscriber logs in and sees this file in his "admin panel" and can download
Answer the question
In order to leave comments, you need to log in
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
//The user has the "author" role
}
embed a block in which the file will be displayed and only the role you write will see it. You can make a post alone in the admin panel and throw a file there and display in the block for subscribers only one specific post with its description in which this file will be.
This is how I would do it. Simple and works.
You can make it easier through ACF, just leave the option field for the site and that's it.
If something is not clear - write
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question