[wp-trac] [WordPress Trac] #16590: get_page_by_title doesn't work for cutom pages

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 18 11:18:40 UTC 2011


#16590: get_page_by_title doesn't work for cutom pages
-------------------------------------+------------------------------
 Reporter:  o----o                   |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |
-------------------------------------+------------------------------
Changes (by duck_):

 * keywords:   => reporter-feedback close


Comment:

 If you mean it's not working for custom post types are you correctly
 specifying the post type you want to look up?

 The function signature is:

 `get_page_by_title($page_title, $output = OBJECT, $post_type = 'page')`

 So if you want to retrieve an 'album' post type, for example, you would
 use:

 `get_page_by_title( 'Album Title', OBJECT, 'album' )`

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16590#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list