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

Add a new filter to change WP_Query args while getting post ID from the url #6345

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Dec 20, 2023

Description

Here we add a new filter rocket_url_to_postid_query_args to change the args passed to WP_Query class while getting the post ID from its url.

To fix the main issue we need to use the following snippet (will create a helper plugin using the following code):

add_filter( 'rocket_url_to_postid_query_args', function( $args ) {
	$args['suppress_filters'] = true;
	return $args;
} );

Fixes #6315

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).

Is the solution different from the one proposed during the grooming?

Yes

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).
  • Any dependent changes have been merged and published in downstream modules.
  • If applicable, I have made corresponding changes to the documentation. Provide a link to the documentation.

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I validated all Acceptance Criteria of the related issues. (If applicable, provide proof).
  • I validated all test plan the QA Review asked me to.

If not, detail what you could not test.

Please describe any additional tests you performed.

@wordpressfan wordpressfan self-assigned this Dec 20, 2023
@wordpressfan
Copy link
Contributor Author

@wp-media/productrocket
Do u think that it'd be better to suppress all filters directly in our core code without using a helper?
For me I like having the filter and provide a helper to change that case by case and see how it goes, what do u think?

@wordpressfan wordpressfan marked this pull request as ready for review December 20, 2023 09:39
@wordpressfan
Copy link
Contributor Author

I agreed with @piotrbak about keeping this in a helper plugin and create another issue to have it in the core after gathering feedback.

@wordpressfan wordpressfan requested a review from a team December 21, 2023 07:21
@Mai-Saad
Copy link
Contributor

Mai-Saad commented Jan 1, 2024

Working as expected.

@Mai-Saad Mai-Saad added this pull request to the merge queue Jan 2, 2024
Merged via the queue into develop with commit ae76c04 Jan 2, 2024
8 checks passed
@Mai-Saad Mai-Saad deleted the fix/6315-abeconnector-conflict branch January 2, 2024 14:49
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.

Conflict with ABEConnector plugin, regression of private posts changes
3 participants