[wp-hackers] Retrieving post id based on the page title

Joost de Valk joost at yoast.com
Sat Sep 12 11:59:18 UTC 2009


There's a get_page_by_title, modify it to use with posts, in fact, it  
should probably be modified within core?

http://xref.yoast.com/2.8.4/nav.html?_functions/get_page_by_title.html

Cheers,
Joost


On Sep 12, 2009, at 1:55 PM, Sudar Muthu wrote:

> Hello all,
>
> I need to know if there is a built-in function (or recommended way) to
> retrieve the post id of a page/post based on the post title, without
> querying the database directly.
>
> I know it can be done by querying the database, but I prefer to use  
> the
> build-in function if available. A quick look into WordPress code,  
> didn't
> reveal any function.
>
> Thanks!
>
> With Regards,
> Sudar
>
> http://SudarMuthu.com
> http://twitter.com/sudarmuthu
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list