我对于具有role = subscriber用户有wordpress网站的权限问题。
具有role = administrator用户可以通过wp media uploader从前端上传图像,只需从同一表单中上传即可。 但是每当用户从同一表单上传图像然后在firebug控制台中我看到/wp-admin/admin-ajax.php ajax返回0状态为200
在那个ajax之后,另一个ajax被称为/wp-admin/async-upload.php ,其中302尝试使用ajax重定向到/wp-login.php?redirect_to=/wp-admin/async-upload.php&reauth=1
我尝试在我的主题function.php中添加各种权限级别,但仍然是同样的错误:
###ROLE FIX FOR UPLOAD FILES if ( current_user_can('subscriber') && !current_user_can('upload_files') ) add_action('init', 'allow_subscriber_uploads'); function allow_subscriber_uploads() { $new_role = get_role('subscriber'); $new_role->add_cap('upload_files'); }我在媒体上传屏幕上看到的只有这个错误: An error occurred in the upload. Please try again later. An error occurred in the upload. Please try again later.
任何帮助或提示将不胜感激。
WordPress版本的网站是:4.5.3
I am having permissions issue with wordpress website for users with role=subscriber.
A user with role=administrator can upload images via wp media uploader from frontend just fine from the same form. But whenever a user uploads image from that same form then in firebug console I see /wp-admin/admin-ajax.php ajax which returns 0 with status 200
And just after that ajax, another ajax is called /wp-admin/async-upload.php with a 302 which tries to redirect using ajax to /wp-login.php?redirect_to=/wp-admin/async-upload.php&reauth=1
I have tried adding various permission levels in my themes function.php but still the same error :
###ROLE FIX FOR UPLOAD FILES if ( current_user_can('subscriber') && !current_user_can('upload_files') ) add_action('init', 'allow_subscriber_uploads'); function allow_subscriber_uploads() { $new_role = get_role('subscriber'); $new_role->add_cap('upload_files'); }All I see on media upload screen is this error: An error occurred in the upload. Please try again later.
Any help or hint would be much appreciated.
Wordpress Version of website is: 4.5.3
最满意答案
这是由于一些插件冲突而不是由于role = subscriber权限问题。
我还添加了members插件,之后问题自动修复。
我仍然不清楚问题是如何解决的,但添加成员插件似乎有所帮助。
It was due to some plugin conflict and not due to permission issues for role=subscriber.
I also added members plugin after which the issue was fixed automatically.
I am still not clear how the issue was fixed but adding the members plugin seemed to help.
更多推荐
发布评论