Open antongorodezkiy opened 10 years ago
same here...
@brandonwamboldt this one seems like the better pr to try and merge, as it allows people to make their own find_one_by_meta
implementation if they so chose.
@josegonzalez It's not quite how I'd want to do it, so I'm working on a bit more flexible way of doing a where on a joined table, that way it's not restricted to custom post types/regular post types (I primarily work with custom tables).
Gotcha, works for me. We also use custom tables at work, so that would be ideal :)
I would therefore close these two PRs
Hello, @brandonwamboldt I used subqueries because I had negative exerience with JOINs for post meta before. You can try too if you have time. Try 6-7 meta conditions or more. In my case I used JOINs first and then had to rewrite all of them to subqueries, because 7 meta JOINs increased query time up to 30 seconds.
@antongorodezkiy I'll evaluate both, though that wasn't the issue I was referring to. You've hard coded the table as $wpdb->postmeta
. I may still add these functions in, but I'd like a more general purpose version as well :smile:
@brandonwamboldt oh, sorry) I really missed that hardcode. :+1:
Method to add meta clause to the search query