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

Remove internal QTS filter hooks #1176

Merged
merged 2 commits into from
May 29, 2022
Merged

Remove internal QTS filter hooks #1176

merged 2 commits into from
May 29, 2022

Conversation

herrvigg
Copy link
Collaborator

@herrvigg herrvigg commented May 28, 2022

The QTS filters come from the legacy plugin:

  • filter: qts_validate_post_slug
  • filter: qts_validate_term_slug
  • filter: qts_permastruct
  • filter: qts_url_args

For easier maintenance and readability, remove those filters and replace them with direct calls instead.
New qtranslate filters will be added on request if the need is justified.

Rename the two validate slugs functions to sanitize (post/term).
Minor cleanup to improve phpdoc and code readability.

The QTS filters come from the legacy plugin. There's no clear
justification to use those in QTX.

For easier maintenance remove those filters and replace them
with direct calls instead.

Rename validate term/post slugs as sanitize.
Fix phpdoc.
@herrvigg
Copy link
Collaborator Author

Reverted the empty string checks. It should never be false with qtranxf but that's for the post title / term name. For the input slugs there might be special cases with false that I don't see well yet. This can probably be rewritten but it's a different topic, it would be for another patch.

@spleen1981 spleen1981 merged commit 7f44a11 into master May 29, 2022
@spleen1981 spleen1981 deleted the slugs-filters branch May 29, 2022 10:21
herrvigg added a commit that referenced this pull request May 29, 2022
The QTS filters come from the legacy plugin:
- filter: `qts_validate_post_slug`
- filter: `qts_validate_term_slug`
- filter: `qts_permastruct`
- filter: `qts_url_args`

For easier maintenance and readability, remove those filters and replace them with direct calls instead.
New `qtranslate` filters will be added on request if the need is justified.

Rename the two `validate` slugs functions to `sanitize` (post/term).
Minor cleanup to improve phpdoc and code readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants