-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Check Capability to create pages on DataViews add new page button #62592
Fix: Check Capability to create pages on DataViews add new page button #62592
Conversation
…s add new page button.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +29 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR works as described.
I confirmed that a user who has access to the Site Editor, but do not have access to creating pages, are not able to create new pages from Appearance > Editor > Pages. The "Add new" button is not present.
#62592) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: carolinan <[email protected]>
I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 3b10fb7 |
#62592) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: carolinan <[email protected]>
We display the "Add New Page" option for all users, causing errors for those without page creation capabilities.
This PR fixes the issue we now check if the user is able to create pages when rendering the button.
Testing Instructions
I pasted this test code on load.php to remove the capability to create pages:
I went to
/wp-admin/site-editor.php?postType=page
and verified that "Add New Page" button was not available.