Hello Stephen,
hope this is the last time I need to bug you – yet, as a special requirement of a client, I need to intercept the render function for the front end form, better said, I need to select certain venues depending on the currently logged in user and not showing all venues. Can you give me a hint where to look for that needed part?
Thanks in advance,
all the best,
Frank
Frank Herget
Hi Frank,
It seems there is no (easy) way of doing this. Being able to replace view classes is on the roadmap, but for the early version I decided to omit this to prevent being ‘locked in’ (ala backwards compatibility) into API that might otherwise change.
For the time being, I’m afraid the only option is either to entirely replace the form view class (which is responsible for iterating through the form’s elements and using their view class to render the element). Or, in this case, I’d suggest just replacing the get_venues()
method of the EO_Event_Form_Element_Event_Venue
class. (There could even be a filter added in here too, which would probably be more appropriate).
Stephen Harris
Hi Stephen,
thanks for the info and pointing me in the right direction. I’ve simply updated the get_venues function, so it will always do some checks on usermeta + event venues. That way I could achieve what I was looking for. Yet, good idea to have that point on the roadmap 🙂
Thanks again,
cheers
Frank
Frank Herget