Changeset 13899 for trunk/wp-includes/post.php
- Timestamp:
- 03/31/2010 08:20:28 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13829 r13899 2752 2752 * 2753 2753 * @param string $page_path Page path 2754 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. 2754 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. Default OBJECT. 2755 * @param string $post_type Optional. Post type. Default page. 2755 2756 * @return mixed Null when complete. 2756 2757 */ … … 2794 2795 * 2795 2796 * @param string $page_title Page title 2796 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. 2797 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. Default OBJECT. 2798 * @param string $post_type Optional. Post type. Default page. 2797 2799 * @return mixed 2798 2800 */ 2799 function get_page_by_title($page_title, $output = OBJECT ) {2801 function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) { 2800 2802 global $wpdb; 2801 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= 'page'", $page_title ));2803 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 2802 2804 if ( $page ) 2803 2805 return get_page($page, $output);
Note: See TracChangeset
for help on using the changeset viewer.