Formatting: Improve the docblock for sanitize_title().

Since sanitize title is largely used for html attributes, or post slugs, make note that accents will be removed and that the string will be limited to alphanumeric characters, underscores, and dashes.

Fixes #33756.
Props ericlewis, swissspidy, wonderboymusic, psdtohtmlguru, DrewAPicture, SergeyBiryukov, sjmur, gma992, shulard, ebinnion, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48432 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2020-07-10 23:26:31 +00:00
parent 7c1ff0845f
commit d42bdcb877

View File

@ -2144,10 +2144,11 @@ function sanitize_key( $key ) {
}
/**
* Sanitizes a title, or returns a fallback title.
* Sanitizes a string into a slug, which can be used in places such as URLs or HTML attributes.
*
* Specifically, HTML and PHP tags are stripped. Further actions can be added
* via the plugin API. If $title is empty and $fallback_title is set, the latter
* In a save context, converts accents to ASCII characters. By default, output is
* further limited to alphanumeric characters, underscore (_) and dash (-) through the
* 'sanitize_title' filter. If $title is empty and $fallback_title is set, the latter
* will be used.
*
* @since 1.0.0