wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



sanitize_url › WordPress Function

Depuis2.3.1
Dépréciéen/a
sanitize_url ( $url, $protocols = null )
Paramètres: (2)
  • (string) $url The URL to be cleaned.
    Requis: Oui
  • (string[]) $protocols Optional. An array of acceptable protocols. Defaults to return value of wp_allowed_protocols().
    Requis: Non
    Défaut: null
Voir:
Retourne:
  • (string) The cleaned URL after esc_url() is run with the 'db' context.
Défini(e) dans:
Codex:
Changelog:
  • 2.8.0
  • 5.9.0

Sanitizes a URL for database or redirect usage.



Source

function sanitize_url( $url, $protocols = null ) {
	return esc_url( $url, $protocols, 'db' );
}