I'm trying to make some content visible only to specific roles but it doesn't seem to work for multiple user roles.
This is the code I'm using to try and make it work with multiple user roles:
if ( user_can( bp_displayed_user_id(), 'level_10','level_1' ) ) {
This one is the only one that works fine:
if ( user_can( bp_displayed_user_id(), 'level_10' ) ) {
Have you looked the description of this function in WordPress Codex. Here it is. As you can see, this function does NOT allow 3rd parameter.
So you need to write like this:
if ( user_can( bp_displayed_user_id(), 'level_10' ) || user_can( bp_displayed_user_id(), 'level_1' ) ) {