Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to add meta clause to the search query #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

antongorodezkiy
Copy link

Method to add meta clause to the search query

@josegonzalez
Copy link

same here...

@josegonzalez
Copy link

@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.

@brandonwamboldt
Copy link
Owner

@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).

@josegonzalez
Copy link

Gotcha, works for me. We also use custom tables at work, so that would be ideal :)

I would therefore close these two PRs

@antongorodezkiy
Copy link
Author

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.

@brandonwamboldt
Copy link
Owner

@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 😄

@antongorodezkiy
Copy link
Author

@brandonwamboldt oh, sorry) I really missed that hardcode. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants