admin管理员组文章数量:1336659
So I've been stuck on this problem for quite a while now and it feels like I've tried everything. I would love for some support here.
Setup
- A WordPress multisite with Bedrock structure
- PHP 7.3.17 (local) and PHP 7.2.24 (live)
- Apache
- Themes: Custom "mother theme" and child themes for each site.
Problem
The first site among the multisites seem to have some kind of structural problem. The other sites works just fine.
When previewing drafts on posts and pages the user (including superadmin) gets a message: Sorry, you are not allowed to preview drafts
. I've tracked it down to _show_post_preview()
in wp-includes/revision.php
and it seems like the nonce check fails.
A similar problem occurs when customizing the site. When trying to save changes you get: You need a higher level of permission. Sorry, you are not allowed to customize this site.
This error is thrown in wp-admin/js/customize-controls.js
in function cheatin()
which seem to be used when the nonce is off.
What I've tried (no luck)
- Deactivating all plugins
- Switching to one of the other child themes that works on their sites
- Clear WordPress cache
- Clear browser cache
- Creating the nonce by myself in the
preview_post_link
filter. - Double, triple check
.htaccess
andwp-config.php
(in Bedrock:config/application.php
)
My .htaccess
:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
RewriteRule . index.php [L]
本文标签: nonceDraft preview and customize permission problems on multisite main site
版权声明:本文标题:nonce - Draft preview and customize permission problems on multisite main site 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742420438a2471547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论