Make WordPress Core

Ticket #45236: 45236.diff

File 45236.diff, 1.9 KB (added by dd32, 7 years ago)
  • wp-admin/includes/post.php

    function get_default_post_to_edit( $post 
    627627                $post->post_category = get_option( 'default_category' );
    628628                $post->page_template = 'default';
    629629                $post->post_parent = 0;
    630630                $post->menu_order = 0;
    631631                $post = new WP_Post( $post );
    632632        }
    633633
    634634        /**
    635635         * Filters the default post content initially used in the "Write Post" form.
    636636         *
    637637         * @since 1.5.0
    638638         *
    639639         * @param string  $post_content Default post content.
    640640         * @param WP_Post $post         Post object.
    641641         */
    642         $post->post_content = apply_filters( 'default_content', $post_content, $post );
     642        $post->post_content = (string) apply_filters( 'default_content', $post_content, $post );
    643643
    644644        /**
    645645         * Filters the default post title initially used in the "Write Post" form.
    646646         *
    647647         * @since 1.5.0
    648648         *
    649649         * @param string  $post_title Default post title.
    650650         * @param WP_Post $post       Post object.
    651651         */
    652         $post->post_title = apply_filters( 'default_title', $post_title, $post );
     652        $post->post_title = (string) apply_filters( 'default_title', $post_title, $post );
    653653
    654654        /**
    655655         * Filters the default post excerpt initially used in the "Write Post" form.
    656656         *
    657657         * @since 1.5.0
    658658         *
    659659         * @param string  $post_excerpt Default post excerpt.
    660660         * @param WP_Post $post         Post object.
    661661         */
    662         $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt, $post );
     662        $post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
    663663
    664664        return $post;
    665665}
    666666
    667667/**
    668668 * Determine if a post exists based on title, content, and date
    669669 *
    670670 * @since 2.0.0
    671671 *
    672672 * @global wpdb $wpdb WordPress database abstraction object.
    673673 *
    674674 * @param string $title Post title
    675675 * @param string $content Optional post content
    676676 * @param string $date Optional post date
    677677 * @return int Post ID if post exists, 0 otherwise.