最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

filters - How can I limit access to uploaded media depending on the logged in user's user role?

programmeradmin2浏览0评论

I have a pretty straight-forward Wordpress site that uses a plugin called Subway to restrict access on the page only to logged in users. There's also the following .htaccess-rule:

RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]

I can define access depending on user role very easily. However, it doesn't seem to work so well with Media attachments.

I am a bit new to Filters in Wordpress, but shouldn't there be a way to restrict access to a file based on a user's user role via functions.php?

Thanks!

发布评论

评论列表(0)

  1. 暂无评论