GatherPress / gatherpress

Powering our community's event management needs.
https://wordpress.org/plugins/gatherpress/
GNU General Public License v2.0
95 stars 30 forks source link

Make default durations filterable #876

Open carstingaxion opened 2 months ago

carstingaxion commented 2 months ago

Is your enhancement related to a problem? Please describe.

While I really like the new duration defaults within the event date block, the suggested default durations might not fit in every use case.

I would love if one could hook into the defaults and modify the list to whatever is needed.

Bonus: If the list gets populated with more than n values, it’ll show as a NumberControl with a calculated steps attribute, based on the given durations.

Designs

As this list seems to be only relevant inside the editor, I would prefer a client side filter in JS.

Describe alternatives you've considered

No response

Code of Conduct

MervinHernandez commented 2 months ago

WCUS_2024 -- Anthony is tackling this one

ajskelton commented 2 months ago

Added PR #882

I was able to add in the Filter, but something was reverting to the defaults when the block was selected.

Here is an example filter.

addFilter(
    'gatherpress.durationOptions',
    'gatherpress/durationOptionsTest',
    (options) => {
        return [
            {
                label: '2 hours',
                value: 2,
            },
            {
                label: '10 hours',
                value: 10,
            },
            {
                label: 'Set an end time...',
                value: false,
            },
        ];
    },
    99
);
MervinHernandez commented 1 month ago

QUEUED for Discussion - October 25

MervinHernandez commented 1 month ago

Faisal --- drag this one over the finish line.

MervinHernandez commented 3 weeks ago

Faisal working on this