Make WordPress Core

Ticket #25157: post.php.diff

File post.php.diff, 818 bytes (added by barrykooij, 11 years ago)
  • wp-page-title/wp-includes/post.php

     
    35053505 */
    35063506function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) {
    35073507        global $wpdb;
    3508         $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) );
     3508        $page_title = array_shift( apply_filters( 'wp_insert_post_data', array( $page_title ), array( 'post_title' => $page_title ) ) );
     3509        $page           = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) );
    35093510        if ( $page )
    35103511                return get_post( $page, $output );
    35113512