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

Fix: Term sync issue during the pagination #4102

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

burhandodhy
Copy link
Contributor

Description of the Change

This PR fixes the issue where an incorrect number of terms were synced when pagination was used. The problem started occurring after merging this change #3654.

Closes #

How to test the Change

Run wp elasticpress sync --setup --show-errors --yes --indexables=term --per-page=10 command and confirm if all the terms are synced.

Changelog Entry

Fixed - Term sync issue

Credits

Props @burhandodhy

Checklist:

@burhandodhy burhandodhy added this to the 5.2.0 milestone Mar 6, 2025
* @since 3.4
* @return {array} New arguments
*/
$total_objects = wp_count_terms( apply_filters( 'ep_term_all_query_db_args', $all_query_args, $args ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we add this filter somewhere else now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter is still used when advanced_pagination is not set

$total_objects = wp_count_terms( apply_filters( 'ep_term_all_query_db_args', $all_query_args, $args ) );

@felipeelia felipeelia assigned burhandodhy and unassigned felipeelia Mar 6, 2025
@burhandodhy burhandodhy assigned felipeelia and unassigned burhandodhy Mar 6, 2025
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.

2 participants