Tobias
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] code to a text value based on a numberHi codepeople and vivanvo!
Thank′s a lot for the fast answer.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] return a Text value from a calculationHi
I need to set the follow code to a text value based on a number:
(function(){
if(fieldname4==’1′) return ‘Liter’;
if(fieldname4==’2′) return ‘m3’;
if(fieldname4==’3′) return ‘kg’;
if(fieldname4==’4′) return ‘Ster’;
if(fieldname4==’5′) return ‘kg’;
});How can i get that?
I read the Text up there and put a javascript into module_public.js:
return isFinite( v ) || /\d{2}[\/\-\.]\d{2}[\/\-\.]\d{4}/.test( v ) || /Liter|m3|kg|Ster/i.test( v );Thank′s for help!
Best regards.
Forum: Plugins
In reply to: [DMSGuestbook] Codestyling Localization not compatibleMany thanks for the feedback!
Forum: Plugins
In reply to: [Event Organiser] Show all Events in ONE Google MapHi,
i have a problem running the hook for tooltips upgrading: https://wp-event-organiser.com/documentation/hook/eventorganiser_venue_tooltip/
Fatal error: Call to undefined function apply_filter() in ../wp-content/plugins/event-organiser/includes/event-organiser-venue-functions.php on line 578
function eo_get_venue_map($venue_slug_or_id='', $args=array()){
#L578 `apply_filter(‘eventorganiser_venue_tooltip’,’my_custom_callback’,10,2);
function my_custom_callback( $tooltip_content, $venue_id ){
//Callback performs operation
return $tooltip_content;
}/**
* Adds upcoming events to the venue tooltip in Event Organiser.
*
* Uses the eventorganiser_venue_tooltip filter to append content to the venue tooltip.
* This tooltip appears when clicking a venue on a map (if tooltips are enabled).
* @uses eventorganiser_venue_tooltip.
*
* The filter passes 2 objects: the content of the toolip, the venue (term) ID
*
* @requires Event Organiser 1.6+
*/add_filter(‘eventorganiser_venue_tooltip’,’my_venue_tooltip_content’,10,2);
function my_venue_tooltip_content( $description, $venue_id ){/* Get events that have not finished yet, at this venue */
$events = eo_get_events(array(
‘showpastevents’=> true,
‘event_end_after’=> ‘today’,
‘tax_query’=>array(
array(
‘taxonomy’=>’event-venue’,
‘field’=>’id’,
‘terms’=>array($venue_id),
),
),
));/* Append the upcoming events to the tooltip content */
$description .= ‘</br></br>’;
$description .= ‘<strong> Upcoming Events </strong>’;if( $events ){
$description .= ‘<ul>’;
/* We have some events, so list them and their date */
foreach( $events as $event ){
$description .= ‘<li>’.get_the_title($event->ID).’ ‘.eo_get_the_start(‘jS M’,$event->ID,null,$event->occurrence_id).'</li>’;
}
$description .= ‘</ul>’;
}else{
/* No upcoming / running events for this venue */
$description .= ‘No upcoming events’;
}
return $description;
}/**
* Adds a link to the venue page to the tooltip
*
* Uses the eventorganiser_venue_tooltip filter to append content to the venue tooltip.
* The filter passes 2 objects: the content of the toolip, the venue (term) ID
*/add_filter(‘eventorganiser_venue_tooltip’,’my_venue_tooltip_content_link_to_venue’,10,2);
function my_venue_tooltip_content( $description, $venue_id ){
$description .= sprintf(‘<p><a href=”%s”> Visit the venue page! </a> </p>’, eo_get_venue_link($venue_id));
return $description;
}
`thanks