[wp-trac] [WordPress Trac] #33074: Query by post_title
WordPress Trac
noreply at wordpress.org
Sat Aug 22 16:58:23 UTC 2015
#33074: Query by post_title
----------------------------------------+-----------------------------
Reporter: wonderboymusic | Owner: wonderboymusic
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.4
Component: Query | Version: 1.5
Severity: normal | Resolution: fixed
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Changes (by wonderboymusic):
* owner: => wonderboymusic
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"33706"]:
{{{
#!CommitTicketReference repository="" revision="33706"
Query:
Add a query var, `title`, that allows you to query posts by `post_title`.
To accomplish this now, you have to do something like:
{{{
$tacos = get_posts( [
'post_type' => 'taco',
's' => $name,
'exact' => true,
'sentence' => true,
'post_status' => 'publish',
'fields' => 'ids',
'posts_per_page' => 1
] );
}}}
Adds unit tests.
Fixes #33074.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33074#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list