Ticket #45236: 45236.diff
| File 45236.diff, 1.9 KB (added by , 7 years ago) |
|---|
-
wp-admin/includes/post.php
function get_default_post_to_edit( $post 627 627 $post->post_category = get_option( 'default_category' ); 628 628 $post->page_template = 'default'; 629 629 $post->post_parent = 0; 630 630 $post->menu_order = 0; 631 631 $post = new WP_Post( $post ); 632 632 } 633 633 634 634 /** 635 635 * Filters the default post content initially used in the "Write Post" form. 636 636 * 637 637 * @since 1.5.0 638 638 * 639 639 * @param string $post_content Default post content. 640 640 * @param WP_Post $post Post object. 641 641 */ 642 $post->post_content = apply_filters( 'default_content', $post_content, $post );642 $post->post_content = (string) apply_filters( 'default_content', $post_content, $post ); 643 643 644 644 /** 645 645 * Filters the default post title initially used in the "Write Post" form. 646 646 * 647 647 * @since 1.5.0 648 648 * 649 649 * @param string $post_title Default post title. 650 650 * @param WP_Post $post Post object. 651 651 */ 652 $post->post_title = apply_filters( 'default_title', $post_title, $post );652 $post->post_title = (string) apply_filters( 'default_title', $post_title, $post ); 653 653 654 654 /** 655 655 * Filters the default post excerpt initially used in the "Write Post" form. 656 656 * 657 657 * @since 1.5.0 658 658 * 659 659 * @param string $post_excerpt Default post excerpt. 660 660 * @param WP_Post $post Post object. 661 661 */ 662 $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt, $post );662 $post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post ); 663 663 664 664 return $post; 665 665 } 666 666 667 667 /** 668 668 * Determine if a post exists based on title, content, and date 669 669 * 670 670 * @since 2.0.0 671 671 * 672 672 * @global wpdb $wpdb WordPress database abstraction object. 673 673 * 674 674 * @param string $title Post title 675 675 * @param string $content Optional post content 676 676 * @param string $date Optional post date 677 677 * @return int Post ID if post exists, 0 otherwise.