public static function canComment($hook, $type, $permission, $params) {

		$entity = elgg_extract('entity', $params);

		if (!$entity instanceof Comment) {
			return $permission;
		}

		if ($entity->getDepthToOriginalContainer() >= (int) elgg_get_plugin_setting('max_comment_depth', 'hypeInteractions')) {
			return false;
		}
	}
public static function canComment($hook, $type, $permission, $params) {

		$entity = elgg_extract('entity', $params);

		if (!$entity instanceof Comment) {
			return $permission;
		}

		if ($entity->getDepthToOriginalContainer() >= (int) elgg_get_plugin_setting('max_comment_depth', 'hypeInteractions')) {
			return false;
		}
	}
public static function canComment ( $ hook , $ type , $ permission , $ params ) { $ entity = elgg_extract ( 'entity' , $ params ) ; if ( ! $ entity instanceof Comment ) { return $ permission ; } if ( $ entity -> getDepthToOriginalContainer ( ) >= ( int ) elgg_get_plugin_setting ( 'max_comment_depth' , 'hypeInteractions' ) ) { return false ; } }
Disallows commenting on comments once a certain depth has been reached

@param string $hook       "permissions_check:comment"
@param string $type       "object"
@param bool   $permission Current permission
@param array  $params     Hook params
@param bool
Disallows commenting on comments once a certain depth has been reached