WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12743 closed enhancement (fixed)

Add $post_type as 3rd parameter to get_page_by_title() in /wp-includes/post.php

Reported by: mikeschinkel Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

This is a simple patch to add $post_type as a 3rd parameter to get_page_by_title() in /wp-includes/post.php. This is essentially identical to the logic for the 3rd parameter just added to get_page_by_path() in the same file.

Attachments (1)

post_type_param_for_get_page_by_title_in_post.php.diff (751 bytes) - added by mikeschinkel 8 years ago.
Adds 3rd parameter to get_page_by_title() in /wp-includes/posts.php

Download all attachments as: .zip

Change History (4)

@mikeschinkel
8 years ago

Adds 3rd parameter to get_page_by_title() in /wp-includes/posts.php

#1 @nacin
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [13899]) Add post type parameter to get_page_by_title(). props mikeschinkel, fixes #12743.

#2 @scribu
8 years ago

It would have been better if we left get_page_by_title() alone and created a more general function:

get_post_by($field, $value, $post_type);

This would be similar to get_term_by().

#3 @nacin
8 years ago

scribu -- Let's use #12726 for get_post_by()

Note: See TracTickets for help on using tickets.