Show ‘organiser’ in tooltip
WordPress Event Management, Calendars & Registration › Forums › Request A Feature › Show ‘organiser’ in tooltip
This topic contains 6 replies, has 2 voices, and was last updated by Denise Wunder 8 years, 1 month ago.
-
AuthorPosts
-
September 21, 2017 at 7:54 am #28467
Dear Stephen,
how can I add the ‘organiser’ (wordpress user who created the event) to the tooltip? I only need to show this. No description, no time, (maybe no title).
How can I add this feature without loosing it after updating the plugin?
Thank you in advance!
Best regards,
Martin
Denise Wunder
September 22, 2017 at 12:20 am #28477Which tooltip? The calendar? You can use the
eventorganiser_event_tooltipfilter: http://codex.wp-event-organiser.com/hook-eventorganiser_event_tooltip.htmlTo get the organiser:
$organiser_id = (int) get_post($event_id)->post_author; $organiser = get_userdata( $organiser_id );If you mean the venue map, that would be trickier: the tooltip is associated with a venue, not the map. You can use the
eventorganiser_venue_tooltipfilter (http://codex.wp-event-organiser.com/hook-eventorganiser_venue_tooltip.html) but you would need to determine how you would get the intended event ID From the venue ID.Stephen Harris
September 22, 2017 at 9:19 am #28479Dear Stephen,
you are right, I meant the calendar tooltip, not the venue tooltip.
Unfortunately, I am not so skilled in PHP coding. Could you give me a more detailed description of what to do? I just need to see the ‘organiser’.
Thanks so much!
Denise Wunder
September 24, 2017 at 11:58 pm #28490Hi Martin,
The following in a theme’s functions.php or a custom plugin should do it:
<?php add_filter( 'eventorganiser_event_tooltip', 'my_event_calendar_tooltip_content', 10, 4 ); function my_event_calendar_tooltip_content( $description, $event_id, $occurrence_id, $post ){ $organiser_id = (int) $post->post_author; $organiser = get_userdata( $organiser_id ); $organiser_name = $organiser->display_name; //Change first value and return it return "Content here... organiser: $organiser_name"; }; ?>Please note, you’ll need to update an event before the changes to take effect.
-
This reply was modified 8 years, 1 month ago by
Stephen Harris.
-
This reply was modified 8 years, 1 month ago by
Stephen Harris.
Stephen Harris
September 25, 2017 at 10:08 am #28497Hi Stepehn,
I tried both methods.
First one was to copy the code at the bottom of my themes function.php file without “<?php” on top.
Second method was to copy the code in a blank php file with “<?php” on top into the wordpress plugin folder.
Nothing worked, even though I’ve always cleared the cache by updating an event.
Could it be that I need to have installed EO Pro? So far I’ve only bought the license, but did not installed it, because i only needed your support 😉
Greetings,
Martin
Denise Wunder
September 25, 2017 at 8:23 pm #28506There were a few errors in my original code snippet, which I’ve since corrected. Pro is not required.
The code should go inside
<?php ... ?>tags (included in the snippet).One easy way to do this is to create a file:
.../wp-content/mu-plugins/calendar-tooltip.phpand paste the entire contents of that snippet (including the<?php ... ?>tags) into it.Stephen Harris
September 25, 2017 at 8:56 pm #28508Absolutely fantastic, Stephen!
Thank you again!
Denise Wunder
-
This reply was modified 8 years, 1 month ago by
-
AuthorPosts
The forum ‘Request A Feature’ is closed to new topics and replies.