Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_make_link_relative ›

Desde2.1.0
Obsoleton/a
wp_make_link_relative ( $link )
Parâmetros:
  • (string) $link Full URL path.
    Required: Yes
Retorna:
  • (string) Absolute path.
Definido em:
Codex:
Log de mudanças:
  • 4.1.0

Convert full URL paths to absolute paths.

Removes the http or https protocols and the domain. Keeps the path '/' at the beginning, so it isn't a true relative link, but from the web root base.



Fonte

function wp_make_link_relative( $link ) {
	return preg_replace( '|^(https?:)?//[^/]+(/?.*)|i', '$2', $link );
}