Opened 11 years ago
Closed 11 years ago
#33074 closed enhancement (fixed)
Query by post_title
| Reported by: | wonderboymusic | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Query | Version: | 1.5 |
| Severity: | normal | Keywords: | has-patch needs-unit-tests |
| Cc: | Focuses: |
Description
If you are using wp_posts as an object store, sometimes you want to do an exists lookup by "name" or "title" - here's what doing that now looks like:
$tacos = get_posts( [ 'post_type' => 'taco', 's' => $name, 'exact' => true, 'sentence' => true, 'post_status' => 'publish', 'fields' => 'ids', 'posts_per_page' => 1 ] );
I don't want to hear any arguments about performance without an acknowledgment that LIKE wildcard searches against serialized meta_values exist.
Attachments (2)
Change History (10)
#3
@
11 years ago
- Keywords has-patch commit added; needs-patch good-first-bug removed
33074.diff accomplishes this
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #33065