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;
	}
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;
	}
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 ; }
Filters river menu

@param string $hook   "register"
@param string $type   "menu:river"
@param array  $return Menu items
@param array  $params Hook params
@return array
Filters river menu