Skip to content

Fix WPML listing visibility across translated languages#13

Open
Arafat-plugins wants to merge 9 commits into
sovware:mainfrom
Arafat-plugins:bug-fix
Open

Fix WPML listing visibility across translated languages#13
Arafat-plugins wants to merge 9 commits into
sovware:mainfrom
Arafat-plugins:bug-fix

Conversation

@Arafat-plugins

Copy link
Copy Markdown
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

This PR fixes Directorist WPML integration issues where translated listings and directory data were not resolving correctly outside the default English language.

Client-reported issue:

  1. WPML is configured with English plus translated languages such as French, German, and Romanian.
  2. Listings exist in the translated language. Example: French has 7 listings.
  3. Opening the translated all listings page, such as /fr/toutes-les-inscriptions/, shows 0 Listings Found.
  4. The Add Listing page may keep loading when switching languages.
  5. Search fields, directory type data, custom fields, AJAX/REST responses, permalinks, and some translated strings can resolve using default-language IDs instead of translated WPML IDs.

What changed:

  1. Added WPML-aware query filtering for Directorist all listings, search results, dashboard, author listings, featured/popular/related widgets, archive queries, taxonomy queries, and REST requests.
  2. Added normalization for _directory_type meta queries so translated directory type IDs are included instead of only the default-language ID.
  3. Added Directory_Type_Meta_Translation to translate _directory_type post and term metadata according to the current WPML language.
  4. Fixed WPML taxonomy element ID handling by converting between WordPress term_id and WPML term_taxonomy_id correctly.
  5. Improved translation handling for add-listing form fields, search form fields, directory builder actions, AJAX directory type translation responses, email translation context, REST API queries, and translated permalinks.
  6. Updated wpml-config.xml so Directorist/WPML field configuration is more complete for translated directory/listing data.
  7. Updated WordPress.org release metadata and docs for version 2.2.3, including readme.txt, README.md, plugin header, changelog, compatibility notes, and .distignore package exclusions.

How to test the changes:

  1. Activate Directorist, WPML Multilingual CMS, WPML String Translation, WPML Media Translation, and Directorist WPML Integration.
  2. Configure WPML languages: English default plus French, German, Romanian, or another translated language.
  3. Translate the Directorist pages, including All Listings, Add Listing, and Search Result pages.
  4. Translate at least one Directorist directory type and several listings into a non-English language.
  5. Open the translated all listings page, for example /fr/toutes-les-inscriptions/.
  6. Confirm the translated listings appear instead of 0 Listings Found.
  7. Open Add Listing in each translated language and confirm the form loads instead of loading indefinitely.
  8. Test search/filter fields, directory type filters, listing categories, sidebar widgets, AJAX-loaded directory fields, REST listing responses, and translated listing permalinks.

Before this change:

  1. Listings appeared only in English/default language.
  2. Translated all listings pages could show 0 Listings Found even when translated listings existed.
  3. Some translated Add Listing/Search/Directory Builder contexts resolved using default-language IDs.
  4. Directory type metadata and taxonomy translation IDs were not consistently mapped through WPML.

After this change:

  1. Translated listings are returned correctly per active WPML language.
  2. Directory type, listing category, and query filters resolve translated IDs correctly.
  3. Add Listing/Search/Directory Builder/AJAX/REST/permalink flows use translated WPML context where available.
  4. WordPress.org release metadata is aligned for 2.2.3.

Testing Result

  • Branch bug-fix was created from the latest upstream/main.
  • PHP lint passed for all plugin PHP files.
  • wpml-config.xml parsed successfully as valid XML.
  • git diff --check passed. Only normal Windows CRLF normalization warnings were reported.
  • WordPress.org metadata check passed: plugin version 2.2.3 matches readme stable tag 2.2.3.
  • WP-CLI was installed locally and verified.
  • Local WP-CLI smoke check confirmed the plugin is active at 2.2.3.
  • Local WPML language smoke check confirmed active languages: bn,en,fr,de,ro.
  • Full local WP-CLI compatibility suite completed with 138 checks, 0 failures.
  • The suite reported 6 non-fatal warnings from WordPress/Directorist core CLI rendering context, not from this integration plugin.

Any linked issues

Fixes: https://taiga-sovware-u10698.vm.elestio.app/project/directorist/issue/2903

Screenshot

Checklist

  • My code follows the WordPress coding standards
  • I updated only Directorist WPML Integration related files.
  • I updated the files required for WordPress.org release metadata.
  • I tested the changes across multiple WPML languages before production handoff.

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.

1 participant