WordPress.org

Make WordPress Core

Changeset 43464


Ignore:
Timestamp:
07/17/2018 07:37:29 AM (20 months ago)
Author:
pento
Message:

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.
Fixes #44341.

File:
1 edited

Legend:

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

    r43337 r43464  
    287287        // Back-compat for the `htmledit_pre` and `richedit_pre` filters
    288288        if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) {
    289             // TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now
    290             _deprecated_function( 'add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
    291             $content = apply_filters( 'htmledit_pre', $content );
     289            /** This filter is documented in wp-includes/deprecated.php */
     290            $content = apply_filters_deprecated( 'htmledit_pre', array( $content ), '4.3.0', 'format_for_editor' );
    292291        } elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) {
    293             _deprecated_function( 'add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
    294             $content = apply_filters( 'richedit_pre', $content );
     292            /** This filter is documented in wp-includes/deprecated.php */
     293            $content = apply_filters_deprecated( 'richedit_pre', array( $content ), '4.3.0', 'format_for_editor' );
    295294        }
    296295
Note: See TracChangeset for help on using the changeset viewer.