A WordPress plugin that allows users with the author role to edit pages where they have been assigned as the author, mimicking the behavior that authors already have for posts.
By default, WordPress authors can create, edit, and delete their own posts, but they cannot do the same with pages. This plugin extends the capabilities of users with the "author" role to allow them to edit (but not create or publish) pages where they have been designated as the author.
- Authors can edit pages where they are marked as the page author
- Authors cannot create new pages
- Authors cannot delete pages
- Authors can only edit their own pages (pages where they are the author)
- Works in a multisite environment
- When the plugin is disabled, author capabilities revert to WordPress defaults
- Upload the
ubc-author-edit-pages
folder to the/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- No configuration is needed - authors will now be able to edit pages where they are assigned as the author
- Create or edit a page and assign an author with the "author" role to it
- The author will now be able to edit that page
- The author will see the "Pages" menu in the admin dashboard
- The author will only see pages where they are the author in the pages list
- The author will not be able to create new pages or delete pages
This plugin uses WordPress's capabilities system to modify what authors can do with pages. It works through two main mechanisms:
-
Role Capabilities: On activation, the plugin adds specific capabilities to the author role:
edit_pages
- Basic capability to see and edit pagesedit_published_pages
- Ability to edit pages that have been publishedpublish_pages
- Ability to update existing pages
-
Capability Filtering: The plugin uses two WordPress filters to dynamically control permissions:
map_meta_cap
- Controls object-specific permissions (can this user edit this specific page?)user_has_cap
- Controls general capabilities (what can this user do with pages?)
-
Admin UI Modifications: The plugin modifies the WordPress admin interface to:
- Show only the author's own pages in the page list
- Remove "Add New" buttons and links
- Prevent access to the new page screen
- Modify row actions to only show appropriate actions
The plugin implements multiple layers of security to ensure authors can only edit their own pages:
- Capability Checks: Both general and object-specific capability checks are implemented
- UI Restrictions: All UI elements for creating new pages are hidden
- Redirect Protection: Direct access to the new page URL is blocked
- Query Filtering: The pages list is filtered to only show the author's own pages
The plugin integrates with WordPress in a non-intrusive way:
- Uses standard WordPress hooks and filters
- Follows WordPress coding standards
- Properly cleans up on deactivation
- Works with the block editor and classic editor
- Compatible with multisite installations
- WordPress 5.0 or higher
- PHP 8.0 or higher
No, authors can only edit existing pages where they have been assigned as the author.
Yes, if you create a draft page (but don't publish it) and assign a user with the role of author to that page, the author user will be able to edit and then publish that page.
No, authors cannot delete pages.
Yes, the plugin works in a multisite environment. It can be activated on individual sites as needed. There are no network settings (or settings of any kind).
The plugin uses multiple methods to prevent page creation:
- It removes the capability to create pages
- It hides the "Add New" button in the UI
- It redirects authors away from the new page screen
- It blocks the ability to publish auto-draft pages
The plugin checks if the user's ID matches the post_author field of the page. If they match, the author is granted permission to edit that page.
- Initial release
Developed by Rich Tape/UBC CTLT