absolute_links = $absolute_links;
$this->permalinks_converter = $permalinks_converter;
}
/**
* convert_text
*
* @param string $text
*
* @return string
*/
public function convert_text( $text ) {
if ( is_string( $text ) ) {
$text = $this->absolute_links->convert_text( $text );
$text = $this->permalinks_converter->convert_text( $text );
}
return $text;
}
public function is_internal_url( $url ) {
$absolute_url = $this->absolute_links->convert_url( $url );
return $url != $absolute_url || $this->absolute_links->is_home( $url );
}
/**
* @param string $url
*
* @return string
*/
public function convert_url( $url ) {
$link = 'removeit';
$link = $this->convert_text( $link );
return str_replace( array( 'removeit' ), array( '', '' ), $link );
}
}