Skip to content

fix: persist listing taxonomies for frontend submissions - #3031

Open
RabbiIslamRony wants to merge 2 commits into
developmentfrom
fix/3334-listing-taxonomy-persistence
Open

RabbiIslamRony wants to merge 2 commits into
developmentfrom
fix/3334-listing-taxonomy-persistence

Conversation

@RabbiIslamRony

@RabbiIslamRony RabbiIslamRony commented Sep 20, 2026

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

Front-end listing authors can select categories, locations, and tags, but WordPress silently skips the tax_input assignment when the author does not have the taxonomy's assign_terms capability. The listing is still created, so its taxonomy selections appear to disappear after submission.

This change explicitly persists the term IDs that Directorist has already validated and normalized. It covers both new submissions and edits, retains empty-array clearing behavior, and leaves taxonomies absent from the submitted form unchanged.

How to reproduce the issue or test the changes:

  1. Submit a listing as an author who can create listings but cannot publish_at_biz_dirs.
  2. Select a category and location, then complete the submission.
  3. Confirm the saved listing retains both selected taxonomies.

Before

The listing is created, but the category and location term arrays are empty.

Listing submission before the taxonomy persistence fix

After

The same restricted-author flow stores both term IDs and the listing renders its saved category.

Listing submission after the taxonomy persistence fix

Verification

  • PHP syntax check for the changed source
  • git diff --check
  • Local WordPress runtime reproduction with a restricted listing-author role
  • Browser verification on the rendered single-listing page

Note: the repository's current WordPressCS dependency aborts under PHP 8.5 before inspecting the files because of its own deprecated nullable parameter signature.

Any linked issues

Checklist

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