0
if(isset($node) && $node->type == 'page') { 
}

In the above code, I need add one more condition, so that it get applied on those pages which was created by users having user role "EDITOR"
Please help.

1 Answer 1

-1
if(isset($node) && $node->type == 'page') {
  if($node->uid) {
    $node_author = user_load($node->uid);
    if(is_object($node_author)) {
      if(in_array("editor",$node_author->roles)) {
        // This is the condition to match the current node author belongs to editor role.
      }
    }
  }
}
1
  • downvote with a reason would have helped me either
    – arpitr
    Commented Jan 4, 2014 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.