Ticket #15805: 15805.diff
File 15805.diff, 773 bytes (added by , 11 years ago) |
---|
-
post.php
3465 3465 function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) { 3466 3466 global $wpdb; 3467 3467 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 3468 $cache_id = "page_title_$page_title"; 3469 3470 if( false === $page = wp_cache_get( $cache_id, 'posts' ) ) { 3471 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 3472 wp_cache_add( $cache_id, $page, 'posts' ); 3473 } 3468 3474 if ( $page ) 3469 3475 return get_post( $page, $output ); 3470 3476