original_string: public static function riverMenuSetup($hook, $type, $return, $params) {
  
  		if (!elgg_is_logged_in()) {
  			return $return;
  		}
  
  		$remove = array('comment');
  		foreach ($return as $key => $item) {
  			if ($item instanceof ElggMenuItem&& in_array($item->getName(), $remove)) {
  				unset($return[$key]);
  			}
  		}
  
  		return $return;
  	}
code: public static function riverMenuSetup($hook, $type, $return, $params) {
  
  		if (!elgg_is_logged_in()) {
  			return $return;
  		}
  
  		$remove = array('comment');
  		foreach ($return as $key => $item) {
  			if ($item instanceof ElggMenuItem&& in_array($item->getName(), $remove)) {
  				unset($return[$key]);
  			}
  		}
  
  		return $return;
  	}
code_tokens: public static function riverMenuSetup ( $ hook , $ type , $ return , $ params ) { if ( ! elgg_is_logged_in ( ) ) { return $ return ; } $ remove = array ( 'comment' ) ; foreach ( $ return as $ key => $ item ) { if ( $ item instanceof ElggMenuItem && in_array ( $ item -> getName ( ) , $ remove ) ) { unset ( $ return [ $ key ] ) ; } } return $ return ; }
docstring: Filters river menu
  
  @param string $hook   "register"
  @param string $type   "menu:river"
  @param array  $return Menu items
  @param array  $params Hook params
  @return array
docstring_tokens: Filters river menu