Skip to content

Order listing-card locations by hierarchy - #2947

Open
RabbiIslamRony wants to merge 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/1681-listing-location-hierarchy-order
Open

Order listing-card locations by hierarchy#2947
RabbiIslamRony wants to merge 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/1681-listing-location-hierarchy-order

Conversation

@RabbiIslamRony

Copy link
Copy Markdown
Member

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

How to reproduce the issue or how to test the changes

  1. Create at least one three-level location hierarchy, such as Country > State > City, and assign all three terms to a published listing.
  2. Add the Location widget to the active all-listing card layout and open the All Listings page.
  3. Confirm the assigned locations render consistently as City, State, Country. Links, the configured separator, and the existing term_links-at_biz_dir-location and the_terms filters must continue to work.
  4. Assign terms from multiple branches and multiple root locations. Confirm roots remain grouped, deeper assigned terms appear first within each group, and names and term IDs provide stable fallback ordering.
  5. Assign a child and grandchild without assigning their root. Confirm the assigned terms are ordered but the unassigned ancestor is not added. Also confirm empty-location cards emit no location output and no term is duplicated.

Verification completed:

  • LocalWP all-listing card rendered 11 assigned terms across multiple branches and roots in the expected hierarchy order.
  • The unassigned test ancestor was omitted, all 11 links were valid, and all 11 labels were unique.
  • Custom before/separator/after values and both native term-output filters were verified.
  • Empty-location output was verified.
  • PHP syntax, targeted composer phpcs, and git diff --check passed.

Any linked issues

Fixes #1681

Checklist

@RabbiIslamRony

Copy link
Copy Markdown
Member Author

The PHPCS job stopped before code checkout because the current development-branch workflow still uses pull_request_target and actions/checkout refuses fork code in that privileged context. No project code or PHPCS command ran. The infrastructure failure is addressed by #2945; this check should be rerun after that PR merges. The changed PHP file passes the repository PHPCS rules locally.

@Armanul46 Armanul46 added this to the v8.9.3 milestone Aug 4, 2026
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