Skip to content
  • This project
    • Loading...
  • Sign in

Commonwell / broker-site

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • broker-site
  • wp-content
  • plugins
  • learndash-hub
  • src
  • traits
  • formats.php
  • Jeff Balicki's avatar
    clean up start · 2d469660 ...
    2d469660
    Signed-off-by: Jeff <jeff@gotenzing.com>
    Jeff Balicki committed 2023-01-09 16:38:45 -0500
formats.php 377 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php

namespace LearnDash\Hub\Traits;

trait Formats {
	/**
	 * Strip protocols
	 *
	 * @param string $url
	 *
	 * @return string
	 */
	public function strips_protocol( string $url ): string {
		$parts = parse_url( $url );

		$host = $parts['host'] . ( isset( $parts['path'] ) ? $parts['path'] : null );
		$host = rtrim( $host, '/' );

		return $host;
	}
}