Support

Home Forums Events Calendar Add-on What is the php filter for event titles?

What is the php filter for event titles?

Posted: July 8, 2016 at 8:44 am

Viewing 14 reply threads


T R

July 8, 2016 at 8:44 am

Hi there, I am trying to get another plugin to work with Event Espresso calendar and it’s almost good to go except for some labels. The author of the other plugin told me I need to get the filter for the event title, what is it for Event Espresso?

Because I need to create my own filter like this:
add_filter( 'THE_name_of_filter_in_event_espresso_FOR_TITLE', 'my_own_filter' );

Thanks for any help.


Josh

  • Support Staff

July 8, 2016 at 10:29 am

Hi there,

I checked and it turns out there isn’t a filter for the event title in the calendar. We can add one though. Are you looking to change the actual text of the event title with your filter function?


T R

July 8, 2016 at 10:42 am

Yes, that would be exactly what I need! There’s actually 4 areas where I need it, not sure if they’d be the same or not:
– Events calendar: event title
– Events calendar: tooltip title
– Events calendar: tooltip excerpt
– Events Widget: event title


Josh

  • Support Staff

July 8, 2016 at 2:21 pm

The excerpt would be a different filter. I guess in order to make sure we add the filters to the right place it’d be really good to know what exactly you’re looking to change and how.


T R

July 8, 2016 at 10:35 pm

This is the full code the plugin author gave me to use for the titles:

add_filter( 'THE_name_of_filter_in_event_plugin_FOR_TITLE', 'my_own_filter' );
function my_own_filter( $title ) {
$title = WPGlobus_Core::text_filter( $title, WPGlobus::Config()->language )
return $title;
}

Right now the titles are showing with all different languages at one time, but with this apparently it will fix it.


Josh

  • Support Staff

July 11, 2016 at 2:13 pm

Thanks, we’ll see what we can come up with.


T R

July 12, 2016 at 8:45 pm

HI there, any update or progress on this? Hoping to have something as I have time-sensitive thing due very soon. Thanks for looking into it!


Josh

  • Support Staff

July 13, 2016 at 10:31 am

Here’s an early copy you can download:

https://github.com/eventespresso/ee4-events-calendar/archive/FET-6671-add-filter-hooks-calendar-title-desc.zip

The above branch adds the following two new filter hooks:

FHEE__EE_Datetime_In_Calendar__to_array_for_json__title
FHEE__EE_Datetime_In_Calendar__to_array_for_json__description


T R

July 13, 2016 at 7:48 pm

HI there, the link is broke, can you double check it, thank you!


Josh

  • Support Staff

July 14, 2016 at 12:07 am

Sorry about that. I gave you a link to a private github repo. Here’s a Dropbox link that you can download:
https://www.dropbox.com/s/5ue3f8w5qvh4pwm/ee4-events-calendar-FET-6671-add-filter-hooks-calendar-title-desc.zip?dl=0


Josh

  • Support Staff

July 14, 2016 at 1:01 pm

The above listed filter hooks are included in the latest update of the Calendar add-on (v.3.2.7).


T R

July 14, 2016 at 8:55 pm

Thank you, yes it did indeed work great on the calendar!

However, there is still a few areas where I need it to do the same thing as I mentioned above. It is still showing multiple languages at the same time for:
– the event title in the back-end (wherever the event title is visible, like the event lists overview)
– the event list widget on the front-end
– when viewing a users event list in their profile on the front-end
– during the registration process on the front-end

Is there a way to use something similar to what was used for the event calendar for everywhere the event titles are shown?

Thanks so much for your help thus far.


Josh

  • Support Staff

July 18, 2016 at 7:20 am

We’ll need to add a filter hook to those areas as well.


T R

July 24, 2016 at 11:45 pm

Hi there, are there any updates or progress on this? Thank you.


Josh

  • Support Staff

July 25, 2016 at 11:15 am

No not currently. We invite anyone who’d like to contribute code to this feature to open a pull request on our Github project.

https://github.com/eventespresso/event-espresso-core

Viewing 14 reply threads

The support post ‘What is the php filter for event titles?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso