Skip to content

Fix Sponsor Levels ordering on Add/Edit Sponsor page#30

Closed
dd32 wants to merge 1 commit intoproductionfrom
fix/claude/1528-sponsor-levels-order-v2
Closed

Fix Sponsor Levels ordering on Add/Edit Sponsor page#30
dd32 wants to merge 1 commit intoproductionfrom
fix/claude/1528-sponsor-levels-order-v2

Conversation

@dd32
Copy link
Copy Markdown
Owner

@dd32 dd32 commented Mar 12, 2026

Summary

  • Adds a get_terms filter that reorders wcb_sponsor_level terms based on the custom order saved via Sponsors > Order Sponsor Levels
  • The sponsor level checkboxes on the Add/Edit Sponsor page now match the configured order instead of using the default alphabetical/registration order

Changes

  • wc-post-types.php: Added order_sponsor_levels() method hooked to get_terms filter. Only applies when fetching wcb_sponsor_level terms exclusively. Uses the wcb_sponsor_level_order option to sort terms by the saved order, with any unordered terms appended at the end.

Test plan

  • Go to Sponsors > Order Sponsor Levels and set a custom order
  • Go to Add New Sponsor - verify the Sponsor Levels checkboxes match the custom order
  • Edit an existing Sponsor - verify the same ordering
  • Verify the Order Sponsor Levels page itself still works correctly

Closes WordPress#1528

Generated with Claude Code

Add a get_terms filter to reorder wcb_sponsor_level terms based on the
custom order saved via the "Order Sponsor Levels" admin page. This ensures
the checkboxes on the Add/Edit Sponsor page match the configured order.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dd32
Copy link
Copy Markdown
Owner Author

dd32 commented Mar 24, 2026

Filed upstream: WordPress#1681

@dd32 dd32 closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant