0

I set Content is going to be saved for Rules Event.

And then the following code in Execute custom PHP code for Rules condition. But it seems to return always TRUE no matter if the user account of node author is Active or Blocked.

return $author->status = 0;

How can I check the user status of node author in Rules condition? I would like the condition which returns TRUE when the the user status of node author is Blocked.

  • 1
    Please edit your question to include more details about your actual rule, like a screenprint of how your rule looks like (using the Rules UI) or something similar. Without that it'll be terribly tough for anybody to help you figuring out what the actual answer to your question is. – Pierre.Vriens Feb 27 '16 at 7:08
1

You need to use the double equation sign. What your code does right now, is that it assigns the value 0 to $author->status.

Here's updated code:

return $author->status == 0;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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