WordPress.org

Make WordPress Core

Changeset 43482


Ignore:
Timestamp:
07/17/2018 03:04:03 PM (19 months ago)
Author:
SergeyBiryukov
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.
Merges [43464] to the 4.9 branch.
Fixes #44341.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/class-wp-editor.php

    r43474 r43482  
    279279        // Back-compat for the `htmledit_pre` and `richedit_pre` filters
    280280        if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) {
    281             // TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now
    282             _deprecated_function( 'add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
    283             $content = apply_filters( 'htmledit_pre', $content );
     281            /** This filter is documented in wp-includes/deprecated.php */
     282            $content = apply_filters_deprecated( 'htmledit_pre', array( $content ), '4.3.0', 'format_for_editor' );
    284283        } elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) {
    285             _deprecated_function( 'add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )' );
    286             $content = apply_filters( 'richedit_pre', $content );
     284            /** This filter is documented in wp-includes/deprecated.php */
     285            $content = apply_filters_deprecated( 'richedit_pre', array( $content ), '4.3.0', 'format_for_editor' );
    287286        }
    288287
Note: See TracChangeset for help on using the changeset viewer.