From ec980c34e0096dbfb23e32aaaa8c04346ed0cd9c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Jul 2018 15:05:25 +0000 Subject: [PATCH] Editor: Use `apply_filters_deprecated()` for some deprecated filters. The `htmledit_pre` and `richedit_pre` filters have been deprecated since 4.3.0, since before `apply_filters_deprecated()` existed. They're now correctly run using `apply_filters_deprecated()`. Props sebastienthivinfocom, lbenicio, ianbelanger. Merges [43464] to the 4.9 branch. Fixes #44341. Built from https://develop.svn.wordpress.org/branches/4.9@43482 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43309 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 9 ++++----- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 31ec6263ca..9ec6b39978 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -278,12 +278,11 @@ final class _WP_Editors { // Back-compat for the `htmledit_pre` and `richedit_pre` filters if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) { - // TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now - _deprecated_function( 'add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )' ); - $content = apply_filters( 'htmledit_pre', $content ); + /** This filter is documented in wp-includes/deprecated.php */ + $content = apply_filters_deprecated( 'htmledit_pre', array( $content ), '4.3.0', 'format_for_editor' ); } elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) { - _deprecated_function( 'add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )' ); - $content = apply_filters( 'richedit_pre', $content ); + /** This filter is documented in wp-includes/deprecated.php */ + $content = apply_filters_deprecated( 'richedit_pre', array( $content ), '4.3.0', 'format_for_editor' ); } if ( false !== stripos( $content, 'textarea' ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index c1b25c82bf..481e37a3f5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.8-alpha-43481'; +$wp_version = '4.9.8-alpha-43482'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.