Make WordPress Core

Changeset 48432


Ignore:
Timestamp:
07/10/2020 11:26:31 PM (4 years ago)
Author:
whyisjake
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r48199 r48432  
    21452145
    21462146/**
    2147  * Sanitizes a title, or returns a fallback title.
    2148  *
    2149  * Specifically, HTML and PHP tags are stripped. Further actions can be added
    2150  * via the plugin API. If $title is empty and $fallback_title is set, the latter
     2147 * Sanitizes a string into a slug, which can be used in places such as URLs or HTML attributes.
     2148 *
     2149 * In a save context, converts accents to ASCII characters. By default, output is
     2150 * further limited to alphanumeric characters, underscore (_) and dash (-) through the
     2151 * 'sanitize_title' filter. If $title is empty and $fallback_title is set, the latter
    21512152 * will be used.
    21522153 *
Note: See TracChangeset for help on using the changeset viewer.