Viewing 3 replies - 1 through 3 (of 3 total)
  • I have exactly the same question! Have you found a solution for this?

    there you have! modified the prive-content.php file of the plugin, and it’s working like a charm! you have to provide the list of users separated by ;

    like this: recipient=”user1;user2″

    case 'none' :
    			$current_user = wp_get_current_user();
    			$users1 = explode(";", $recipient);
    			$rcpt=null;
    
    			for($i=0;$i<count($users1);$i++) {
    				if ( $current_user->user_login == $users1[$i] ) {
    					$rcpt = $users1[$i];
    					break;
    				}
    
    			}
    			if ( $rcpt != null ) {
    				$text = $container_open . ' class="private user-content user-only ' . esc_attr( $rcpt ) . '-only"' . $align_style . '>' . $content . $container_close;
    			} else {
    				if ( $alt ) {
    					$text = $container_open . ' class="private alt-text"' . $align_style . '>' . $alt . $container_close;
    				}
    			}
    			break;
    Plugin Author Aldo Latino

    (@aldolat)

    Hello all,
    I was not aware of this post. The forum didn’t send me any email.

    Anyway, your request has just been added to the plugin and now it supports multiple users!

    Multiple users are added via a comma separated list of login names:

    recipient="user1,user2, user3"

    You can safely use a space after the comma.

    @brunolopes446

    I used this code in order to add this functionality:

    case 'none' :
    	$all_recipients = array_map( 'trim', explode( ',', $recipient ) );
    	$current_user = wp_get_current_user();
    	if ( in_array( $current_user->user_login, $all_recipients ) ) {
    		$text = $container_open . ' class="private user-content user-only ' . esc_attr( $current_user->user_login ) . '-only"' . $align_style . '>' . $content . $container_close;
    	} else {
    		$text = '';
    		if ( $alt ) {
    			$text = $container_open . ' class="private alt-text"' . $align_style . '>' . $alt . $container_close;
    		}
    	}
    	break;

    Enjoy the new version! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘private for more than one "login_name"’ is closed to new replies.