Ticket #10865 (closed enhancement: wontfix)
Function to get posts based on post title
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Template | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | sudar@…, willmot |
Description
Right now we don't have a template function to get posts based on the post title.
We have a function called get_page_by_title (in wp-includes/post.php) which retrieves pages (but not posts) based on title.
I propose a new function get_post_by_title() which could retrieve posts gives page titles.
Attachments
Change History
please add a description of the possible return values to the docblock comment.
Replying to hakre:
please add a description of the possible return values to the docblock comment.
Updated the patch with description of the possible return values to the docblock comment.
-
attachment
get_post_by_title.patch
added
Patch with get_post_by_title() function
- Cc willmot added
- Milestone changed from Unassigned to 2.9
I'd like to take this further and bring the get_post functionality inline with get_terms by adding a
get_post_by( 'field', 'value', $args = optional ( 'post_type' and/or 'post_status ) ); function.
I'll write a patch if there's any interest.
- Status changed from new to closed
- Resolution set to wontfix
get_page_by_title() now has a post_type parameter
