Make WordPress Core

Ticket #38719: 38719.wip.diff

File 38719.wip.diff, 1.1 KB (added by westonruter, 10 years ago)
  • src/wp-includes/theme.php

    diff --git src/wp-includes/theme.php src/wp-includes/theme.php
    index a36fe79..c1c9c24 100644
    function _wp_customize_include() {  
    25492549 * @param WP_Post $changeset_post Changeset post object.
    25502550 */
    25512551function _wp_customize_publish_changeset( $new_status, $old_status, $changeset_post ) {
    2552         global $wp_customize;
     2552        global $wp_customize, $wpdb;
    25532553
    25542554        $is_publishing_changeset = (
    25552555                'customize_changeset' === $changeset_post->post_type
    function _wp_customize_publish_changeset( $new_status, $old_status, $changeset_p  
    26002600         * and thus garbage collected.
    26012601         */
    26022602        if ( ! wp_revisions_enabled( $changeset_post ) ) {
     2603                $has_kses = ( false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' ) );
     2604                if ( $has_kses ) {
     2605                        kses_remove_filters(); // Prevent KSES from corrupting JSON in post_content.
     2606                }
    26032607                wp_trash_post( $changeset_post->ID );
     2608                if ( $has_kses ) {
     2609                        kses_init_filters();
     2610                }
     2611                // @todo Remove '__trashed' suffix from post_name.
     2612                // @todo Should wp_trash_post() be used at all? Or should an approach like wp_publish_post() be used?
    26042613        }
    26052614}
    26062615