Skip to content
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 predefined list of users when applying user-based access #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ cache:

matrix:
include:
- php: 5.3
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.3
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=1
- php: 5.3
- php: 5.6
env: WP_VERSION=3.7 WP_MULTISITE=0
- php: 5.3
- php: 5.6
env: WP_VERSION=3.7 WP_MULTISITE=1
- php: 7.0
env: WP_VERSION=latest WP_MULTISITE=0
Expand Down
3 changes: 2 additions & 1 deletion classes/class-editorial-access-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ public function access_form( $post_type, $post_id = null, $bulk = true ) {
if ( $allowed_users === '' ) {
// get default allowed users since we have never saved allowed users for this post

$allowed_users = array();
foreach ( $users as $user_object ) {

if ( user_can( $user_object->ID, $edit_others_posts_cap ) ) {
$allowed_users = $user_object->ID;
$allowed_users[] = $user_object->ID;
}
}

Expand Down