Ticket #15805: 15805.patch
File 15805.patch, 810 bytes (added by , 14 years ago) |
---|
-
wp-includes/post.php
3169 3169 */ 3170 3170 function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) { 3171 3171 global $wpdb; 3172 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 3172 3173 $cache_id = "page_title_$page_title"; 3174 3175 if( false === $page = wp_cache_get( $cache_id, 'posts' ) ) { 3176 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 3177 wp_cache_add( $cache_id, $page, 'posts' ); 3178 } 3179 3173 3180 if ( $page ) 3174 3181 return get_page($page, $output); 3175 3182