1. Home
  2. Knowledge Base
  3. Customization
  4. Change or extend content of each location bubble

Change or extend content of each location bubble

You can use the Hook oum_locations_bubble_content to manipulate the content of the info bubbles of locations.

Insert the following PHP code in the functions.php of your theme:

PHP
add_filter('oum_location_bubble_content', function ( $content, $location ) {

    // extend or change content

    $content .= 'Post ID: ' . $location['post_id'];

    return $content;

}, 10, 2);

To add a value from default fields edit this line:

PHP
add_filter('oum_location_bubble_content', function ( $content, $location ) {

    // extend or change content

    $content .= $location['post_id']; // use post_id, date, title, address, lat, lng, text, image, audio

    return $content;

}, 10, 2);

And to add a value from a custom field:

PHP
add_filter('oum_location_bubble_content', function ( $content, $location ) {

    // extend or change content

    $content .= oum_get_location_value('CUSTOM FIELD LABEL', $location['post_id']);

    return $content;

}, 10, 2);

Change CUSTOM FIELD LABEL to the name of your custom field.

Hint: To remove the existing content from the bubble add this line at first:

PHP
add_filter('oum_location_bubble_content', function ( $content, $location ) {

    // extend or change content
    
    $content = '';

    $content .= 'Post ID: ' . $location['post_id'];

    return $content;

}, 10, 2);
Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

EN