wp_richedit_pre

The timeline below displays how wordpress function wp_richedit_pre has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.6

/**
 * Formats text for the rich text editor.
 *
 * The {@see 'richedit_pre'} filter is applied here. If `$text` is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 * @deprecated 4.3.0 Use format_for_editor()
 * @see format_for_editor()
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    _deprecated_function(__FUNCTION__, '4.3.0', 'format_for_editor()');
    if (empty($text)) {
        /**
         * Filters text returned for the rich text editor.
         *
         * This filter is first evaluated, and the value returned, if an empty string
         * is passed to wp_richedit_pre(). If an empty string is passed, it results
         * in a break tag and line feed.
         *
         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
         * return after being formatted.
         *
         * @since 2.0.0
         * @deprecated 4.3.0
         *
         * @param string $output Text for the rich text editor.
         */
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    /** This filter is documented in wp-includes/deprecated.php */
    return apply_filters('richedit_pre', $output);
}

WordPress Version: 4.9

/**
 * Formats text for the rich text editor.
 *
 * The {@see 'richedit_pre'} filter is applied here. If $text is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 * @deprecated 4.3.0 Use format_for_editor()
 * @see format_for_editor()
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    _deprecated_function(__FUNCTION__, '4.3.0', 'format_for_editor()');
    if (empty($text)) {
        /**
         * Filters text returned for the rich text editor.
         *
         * This filter is first evaluated, and the value returned, if an empty string
         * is passed to wp_richedit_pre(). If an empty string is passed, it results
         * in a break tag and line feed.
         *
         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
         * return after being formatted.
         *
         * @since 2.0.0
         * @deprecated 4.3.0
         *
         * @param string $output Text for the rich text editor.
         */
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    /** This filter is documented in wp-includes/deprecated.php */
    return apply_filters('richedit_pre', $output);
}

WordPress Version: 4.6

/**
 * Formats text for the rich text editor.
 *
 * The {@see 'richedit_pre'} filter is applied here. If $text is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 * @deprecated 4.3.0
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    _deprecated_function(__FUNCTION__, '4.3.0', 'format_for_editor()');
    if (empty($text)) {
        /**
         * Filters text returned for the rich text editor.
         *
         * This filter is first evaluated, and the value returned, if an empty string
         * is passed to wp_richedit_pre(). If an empty string is passed, it results
         * in a break tag and line feed.
         *
         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
         * return after being formatted.
         *
         * @since 2.0.0
         * @deprecated 4.3.0
         *
         * @param string $output Text for the rich text editor.
         */
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    /** This filter is documented in wp-includes/deprecated.php */
    return apply_filters('richedit_pre', $output);
}

WordPress Version: 4.3

/**
 * Formats text for the rich text editor.
 *
 * The filter 'richedit_pre' is applied here. If $text is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 * @deprecated 4.3.0
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    _deprecated_function(__FUNCTION__, '4.3', 'format_for_editor()');
    if (empty($text)) {
        /**
         * Filter text returned for the rich text editor.
         *
         * This filter is first evaluated, and the value returned, if an empty string
         * is passed to wp_richedit_pre(). If an empty string is passed, it results
         * in a break tag and line feed.
         *
         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
         * return after being formatted.
         *
         * @since 2.0.0
         * @deprecated 4.3.0
         *
         * @param string $output Text for the rich text editor.
         */
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    /** This filter is documented in wp-includes/deprecated.php */
    return apply_filters('richedit_pre', $output);
}

WordPress Version: 3.8

/**
 * Formats text for the rich text editor.
 *
 * The filter 'richedit_pre' is applied here. If $text is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    if (empty($text)) {
        /**
         * Filter text returned for the rich text editor.
         *
         * This filter is first evaluated, and the value returned, if an empty string
         * is passed to wp_richedit_pre(). If an empty string is passed, it results
         * in a break tag and line feed.
         *
         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
         * return after being formatted.
         *
         * @since 2.0.0
         *
         * @param string $output Text for the rich text editor.
         */
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    /** This filter is documented in wp-includes/formatting.php */
    return apply_filters('richedit_pre', $output);
}

WordPress Version: 3.7

/**
 * Formats text for the rich text editor.
 *
 * The filter 'richedit_pre' is applied here. If $text is empty the filter will
 * be applied to an empty string.
 *
 * @since 2.0.0
 *
 * @param string $text The text to be formatted.
 * @return string The formatted text after filter is applied.
 */
function wp_richedit_pre($text)
{
    // Filtering a blank results in an annoying <br />\n
    if (empty($text)) {
        return apply_filters('richedit_pre', '');
    }
    $output = convert_chars($text);
    $output = wpautop($output);
    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option('blog_charset'));
    return apply_filters('richedit_pre', $output);
}