WordPress.org

Make WordPress Core

Changeset 34727


Ignore:
Timestamp:
10/01/2015 02:00:42 AM (3 years ago)
Author:
DrewAPicture
Message:

Formatting: Rename the $richedit parameter in format_to_edit() to $rich_text.

Previously, it was necessary to explain in a double-negative that $richedit being false would prevent $content from being passed through esc_textarea(). The updated $rich_edit name and documentation now better reflects the intent of the parameter.

Fixes #21613.

File:
1 edited

Legend:

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

    r34675 r34727  
    18441844 *
    18451845 * @since 0.71
    1846  *
    1847  * @param string $content  The text about to be edited.
    1848  * @param bool   $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed).
     1846 * @since 4.4.0 The `$richedit` parameter was renamed to `$rich_text` for clarity.
     1847 *
     1848 * @param string $content   The text about to be edited.
     1849 * @param bool   $rich_text Optional. Whether `$content` should be considered rich text,
     1850 *                          in which case it would not be passed through esc_textarea().
     1851 *                          Default false.
    18491852 * @return string The text after the filter (and possibly htmlspecialchars()) has been run.
    18501853 */
    1851 function format_to_edit( $content, $richedit = false ) {
     1854function format_to_edit( $content, $rich_text = false ) {
    18521855    /**
    18531856     * Filter the text to be formatted for editing.
     
    18581861     */
    18591862    $content = apply_filters( 'format_to_edit', $content );
    1860     if ( ! $richedit )
     1863    if ( ! $rich_text )
    18611864        $content = esc_textarea( $content );
    18621865    return $content;
Note: See TracChangeset for help on using the changeset viewer.