#10865 closed enhancement (wontfix)
Function to get posts based on post title
Reported by: | sudar | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Template | Keywords: | |
Focuses: | Cc: |
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 (1)
Change History (9)
#3
in reply to:
↑ 2
@
15 years ago
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.
#4
@
15 years ago
- 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.
Note: See
TracTickets for help on using
tickets.
please add a description of the possible return values to the docblock comment.