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

Matching half of the taxonomy then throwing 404 #51

Open
NomanTee opened this issue Jul 10, 2021 · 0 comments
Open

Matching half of the taxonomy then throwing 404 #51

NomanTee opened this issue Jul 10, 2021 · 0 comments

Comments

@NomanTee
Copy link

Hi,
I am new to this plugin and have noticed an issue with the following query, i dont know whether it is intended but it seems to have issues:

SELECT * FROM wp_termmeta WHERE meta_key = 'permalink_customizer' AND meta_value != '' AND ( LOWER(meta_value) = LEFT(LOWER('jobs/it-jobs-in-usa'), LENGTH(meta_value)) OR LOWER(meta_value) = LEFT(LOWER('jobs/it-jobs-in-usa/'), LENGTH(meta_value)) ) ORDER BY LENGTH(meta_value) DESC, wp_iiqk6k_termmeta.term_id ASC LIMIT 1

So the above query essentially returns the following result:

# meta_id, term_id, meta_key, meta_value '102', '9', 'permalink_customizer', 'jobs/it-jobs'

Now this seems partial incorrect result, I would expect to return nothing. The issue is I have a filter for this slug so it should be caught by the filter when no results are found but this returns incorrect result. Moreover, after returning the result the following function is called:

str_replace( trim( strtolower( $taxonomy_term_data[0]->meta_value ), '/' ), $get_term_permalink, trim( strtolower( $request ) ) );

This basically makes the request url this:

"job_category/it-jobs/-in-usa"

Resulting in 404 so serving no purpose whatsoever.

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

No branches or pull requests

1 participant