Yoast\WP\SEO\Helpers

Sanitization_Helper::sanitize_url()publicYoast 1.0

Sanitize a url for saving to the database. Not to be confused with the old native WP function.

{} Это метод класса: Sanitization_Helper{}

Хуков нет.

Возвращает

Строку. The sanitized URL.

Использование

$Sanitization_Helper = new Sanitization_Helper();
$Sanitization_Helper->sanitize_url( $value, $allowed_protocols, fooo ] );
$value(строка) (обязательный)
String URL value to sanitize.
$allowed_protocols(массив)
Optional set of allowed protocols.
По умолчанию: [ foo
fooo ] (обязательный)
-

Код Sanitization_Helper::sanitize_url() Yoast 19.6.1

public function sanitize_url( $value, $allowed_protocols = [ 'http', 'https' ] ) {
	return WPSEO_Utils::sanitize_url( $value, $allowed_protocols );
}