public static function user_trailingslashit( $link ) {
		$link_parts = parse_url($link);

		if ( !$link_parts ) {
			return $link;
		}

		if ( isset($link_parts['path']) && $link_parts['path'] != '/' ) {
			$new_path = user_trailingslashit($link_parts['path']);

			if ( $new_path != $link_parts['path'] ) {
				$link = str_replace($link_parts['path'], $new_path, $link);
			}
		}
		return $link;
	}