From ec9ec3138eb78307965f9fb00e864b6c6c0cc3c2 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 1 Oct 2015 02:01:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@34727 git-svn-id: http://core.svn.wordpress.org/trunk@34691 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 11 +++++++---- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index e2d8c95552..8287d950cc 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1843,12 +1843,15 @@ function force_balance_tags( $text ) { * it is simply a holder for the 'format_to_edit' filter. * * @since 0.71 + * @since 4.4.0 The `$richedit` parameter was renamed to `$rich_text` for clarity. * - * @param string $content The text about to be edited. - * @param bool $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed). + * @param string $content The text about to be edited. + * @param bool $rich_text Optional. Whether `$content` should be considered rich text, + * in which case it would not be passed through esc_textarea(). + * Default false. * @return string The text after the filter (and possibly htmlspecialchars()) has been run. */ -function format_to_edit( $content, $richedit = false ) { +function format_to_edit( $content, $rich_text = false ) { /** * Filter the text to be formatted for editing. * @@ -1857,7 +1860,7 @@ function format_to_edit( $content, $richedit = false ) { * @param string $content The text, prior to formatting for editing. */ $content = apply_filters( 'format_to_edit', $content ); - if ( ! $richedit ) + if ( ! $rich_text ) $content = esc_textarea( $content ); return $content; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9042c8a136..3748d0d626 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34726'; +$wp_version = '4.4-alpha-34727'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.