Changeset 1033497
- Timestamp:
- 11/27/2014 01:17:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
super-simple-post-page-restricor/trunk/super-simple-post-page-restrictor.php
r951353 r1033497 4 4 Plugin URI: https://github.com/arippberger/super-simple-post-page-restrictor 5 5 Description: Adds a super simple post / page restriction option 6 Version: 1. 06 Version: 1.1 7 7 Author: arippberger 8 8 Author URI: http://alecrippberger.com … … 93 93 94 94 //loop through current user roles and check if any roles are in restricted roles array 95 foreach ($current_user_roles as $key => $role) { 96 if ( in_array( $role, $restricted_roles) ) { 97 //restrict access 98 $current_user_can_access = false; 95 if ( is_array( $current_user_roles ) ) { //first check if is array (settings need to be set) 96 foreach ($current_user_roles as $key => $role) { 97 if ( is_array( $restricted_roles ) && in_array( $role, $restricted_roles) ) { //if restricted roles is set (is_array()) and current role is in restricted roles 98 //restrict access 99 $current_user_can_access = false; 100 } 99 101 } 100 102 }
Note: See TracChangeset
for help on using the changeset viewer.