Skip to content

Conversation

@stoffl6781
Copy link

@stoffl6781 stoffl6781 commented Nov 11, 2025

Summary

This PR extends the Tickets Additional Fields extension with two native field types: date and select.

Motivation

Events often require structured ticket metadata, e.g.:

  • a specific module day or course date
  • a controlled choice (language, level, location, etc.)

Until now these values had to be stored as free text.
This PR introduces proper field types to improve data integrity and UI consistency.

What this PR does

  • Adds new field type date
    • Renders an HTML5 <input type="date"> in the ticket editor (Classic + Block)
    • Stores values in ISO format (YYYY-MM-DD)
  • Adds new field type select
    • Renders a <select> element with configurable options
    • Stores the raw option value; displays the option label in frontend/shortcodes
  • Enhances shortcode output to format date values (filterable)

Technical notes

  • No breaking changes

  • Date field

    • Falls back to raw string if a non-ISO date is stored
    • Output formatting can be customized:
      add_filter(
          'tribe_ext_tickets_additional_fields_date_display_format',
          fn() => 'j. F Y'
      );
  • Select field

    • Saves option values consistently
    • Frontend output automatically resolves to the configured option label
    • All output is filterable if further customization is needed

    @andrasguseo

@stoffl6781
Copy link
Author

@andrasguseo :) thank you

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