From d42bdcb877ff6db7c2ea0d92668ae31b3ade19f3 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 10 Jul 2020 23:26:31 +0000 Subject: [PATCH] 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 --- src/wp-includes/formatting.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 8d51492a13..65fe00abf8 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -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