Skip to content

Fix custom badge editor control width and docs#2920

Open
RabbiIslamRony wants to merge 5 commits into
sovware:developmentfrom
RabbiIslamRony:codex/fix-badge-input-width-docs
Open

Fix custom badge editor control width and docs#2920
RabbiIslamRony wants to merge 5 commits into
sovware:developmentfrom
RabbiIslamRony:codex/fix-badge-input-width-docs

Conversation

@RabbiIslamRony

@RabbiIslamRony RabbiIslamRony commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

This PR updates the Directorist Appearance > Badges work so badge rules are safer and more complete across settings, builder metadata, and frontend matching.

  • Adds/updates the custom badge manager behavior for core and custom badges.
  • Keeps New, Popular, and Featured backward-compatible while allowing custom badge rules in directorist_badge_rules.
  • Supports General, Field, and Pricing plan badge conditions without changing the save payload or option storage.
  • Keeps custom badges additive: archive widgets must be placed manually, and single listing custom badges stay disabled until enabled in the grouped Badges widget.
  • Preserves builder chip UI while frontend/admin preview badge output uses saved badge labels, icons, colors, borders, and tooltip values.

Latest Updates

  • Field condition metadata now reads raw directory builder fields, so Pricing Plans add-listing gating does not hide Badge condition choices in Settings.
  • Runtime condition matching now decodes encoded operators like <=, >=, and ≠ before frontend matching.
  • Pricing plan metadata includes published v4 directorist_plans rows in addition to legacy/Woo sources.
  • Pricing runtime checks support legacy _fm_plans, v4 _plan_id, and active v4 package assignment.
  • Badge QA docs were updated with the verified condition-source and operator-normalization guardrails.

QA Results

  • php -l includes/class-helper.php passed.
  • php -l includes/classes/class-settings-panel.php passed.
  • git diff --check passed for the touched PHP/docs files.
  • Runtime condition matrix passed 48/48 cases:
    • General: age, views, rating, review count, featured status, listing status.
    • Field: text-like, number, select, radio, checkbox, switch, date, time, color, taxonomy, image, video, file, button, map, privacy.
    • Pricing: _fm_plans, _plan_id, and active package assignment.
    • AND/OR, conditionless custom, invalid custom fail-closed, encoded and double-encoded operators.
  • Admin payload QA passed:
    • 6 General options.
    • 90 Field options on the current local site.
    • 3 Pricing plan options: Codex Badge Free Starter, Codex Badge Pro Monthly, Codex Badge Priority PPL.
    • Fresh Badges page Save button disabled.
    • No console/page errors.
  • Temporary metadata matrix passed 29/29 supported field types and confirmed Pricing, Social Info, and Business Hours do not leak into the Field source.

Notes

  • No migration, new option key, AJAX action, nonce/capability change, builder maxWidget change, or frontend wrapper rewrite is introduced.
  • No build command was run for the latest condition-source fix.

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