WordPress.org

Make WordPress Core

Changeset 48444


Ignore:
Timestamp:
07/12/2020 01:11:35 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for sanitize_user(), sanitize_title(), sanitize_title_with_dashes().

See #49572.

File:
1 edited

Legend:

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

    r48441 r48444  
    20852085 *
    20862086 * @param string $username The username to be sanitized.
    2087  * @param bool   $strict   If set limits $username to specific characters. Default false.
     2087 * @param bool   $strict   Optional. If set limits $username to specific characters.
     2088 *                         Default false.
    20882089 * @return string The sanitized username, after passing through filters.
    20892090 */
     
    21132114     * @param string $username     Sanitized username.
    21142115     * @param string $raw_username The username prior to sanitization.
    2115      * @param bool   $strict       Whether to limit the sanitization to specific characters. Default false.
     2116     * @param bool   $strict       Whether to limit the sanitization to specific characters.
    21162117     */
    21172118    return apply_filters( 'sanitize_user', $username, $raw_username, $strict );
     
    21212122 * Sanitizes a string key.
    21222123 *
    2123  * Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.
     2124 * Keys are used as internal identifiers. Lowercase alphanumeric characters,
     2125 * dashes, and underscores are allowed.
    21242126 *
    21252127 * @since 3.0.0
     
    21452147
    21462148/**
    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
    2152  * will be used.
     2149 * Sanitizes a string into a slug, which can be used in URLs or HTML attributes.
     2150 *
     2151 * By default, converts accent characters to ASCII characters and further
     2152 * limits the output to alphanumeric characters, underscore (_) and dash (-)
     2153 * through the {@see 'sanitize_title'} filter.
     2154 *
     2155 * If `$title` is empty and `$fallback_title` is set, the latter will be used.
    21532156 *
    21542157 * @since 1.0.0
    21552158 *
    21562159 * @param string $title          The string to be sanitized.
    2157  * @param string $fallback_title Optional. A title to use if $title is empty.
    2158  * @param string $context        Optional. The operation for which the string is sanitized
     2160 * @param string $fallback_title Optional. A title to use if $title is empty. Default empty.
     2161 * @param string $context        Optional. The operation for which the string is sanitized.
     2162 *                               Default 'save'.
    21592163 * @return string The sanitized string.
    21602164 */
     
    22072211 *
    22082212 * @param string $title     The title to be sanitized.
    2209  * @param string $raw_title Optional. Not used.
     2213 * @param string $raw_title Optional. Not used. Default empty.
    22102214 * @param string $context   Optional. The operation for which the string is sanitized.
     2215 *                          Default 'display'.
    22112216 * @return string The sanitized title.
    22122217 */
Note: See TracChangeset for help on using the changeset viewer.