churchthemes / church-theme-framework

A library of code useful for developing church WordPress themes that use the Church Content plugin.
https://churchthemes.com/guides/developer/framework/
GNU General Public License v2.0
31 stars 13 forks source link

added slug support and original arg support to filter in get_events #9

Closed mfahlsing closed 3 years ago

mfahlsing commented 8 years ago

I am using this primarily to add options to the CTC_Events_Widget pull-down. One use case I have is I create categories where there are posts in common with events. Then I add an option to show 'events related to the category' in the widget, pre-process the 'active category' in the widget and pass it to the query as a term slug instead of an id. (the category and events taxonomies have slugs in common)

A similar or even more advanced query manipulation could be done when you add $args to the query filter. Then you can parse specific other options that the in-built logic (id, term, all, date, limit) doesn't handle.

I noticed that I use spaces and you use tabs. I can change that and update the request if needed.

stevengliebe commented 8 years ago

Thank you, I will give this a closer look when I am able to.

stevengliebe commented 7 years ago

It's been a while so I want to ask if this is still something you need before I spend time on it.

mfahlsing commented 7 years ago

Hey Steven!

I was on vacation, so I am just now getting to this. I ended up disabling event categories and using the core categories on events. Then I created a custom ctfw_get_events function in order to support the $args I wanted. In addition I created a custom widget that I use instead of the theme ctc events widget, mostly to modify the category drop-down and a couple other options.

The addition of the passed $args to the query_args hook would mean I could eliminate my custom get_events function. That would be primary benefit for me, not having to maintain a parallel get_events. I guess I don't need the ability to look up the ctc_event_category by slug, although that may help others.

Implementing the extra $args on the hook might also make it so I could eliminate my custom widget and use the theme one. I would need to see if there is another hook to override the drop-down selections in the widget.

stevengliebe commented 7 years ago

Okay, do you want to change your pull request or would this one still meet your needs?