• Resolved marko2002

    (@marko2002)


    Hi Daniel, firstly I’ve been using your 7 day trial pro plugin and am really impressed, although I still have some way to go in regards to being able to list and sort the data I’m collecting (or at least understand how to do it myself) I’m sure this will be something possible for the future or even something you may consider introducing in the pro version as I intend on purchasing the plugin myself very shortly (i.e. make it easier to make a table for example containing the data collected), but before I do can I just confirm it would be possible to have multiple responses from the pro drop down fields listed on the map as bullet points.

    For example, at the moment if the front end user is able to choose more than one option, let’s say Option1|Option2|Option3|Option4 and they choose them all, it shows on the front-end pop up as Option1,Option2,Option3,Option4. Would it be possible to have it show as

    Option1
    Option2
    Option3
    Option4

    • This topic was modified 1 year, 11 months ago by marko2002.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author 100plugins

    (@100plugins)

    Hi @marko2002,

    Thanks for reaching out. Glad you like the trial!

    One of the next features I will release is to implement a couple of WordPress Hooks. Basically hooks are a way to manipulate the output of a WordPress plugin or theme. They can be used programmatically with PHP.

    Don’t worry if this sounds too complicated. It’s just a single line of code and I will make sure to publish code examples on how to use them. Turning the comma separated list into bullet points will be one example.

    However, this will take a bit of time as I’m currently working on other features before. But I will keep you updated!

    Best Regards,
    Daniel

    Plugin Author 100plugins

    (@100plugins)

    Hi @marko2002,

    Just wanted to let you know that version 1.3.2 is out. This makes WordPress Hooks available. You will find details on how to use them under Settings > Open User Map > Help & Getting Started > Hooks.

    Here is a code example for your use case:

    add_filter('oum_location_bubble_content', function ( $content, $location ) {        
    
        $YOUR_CUSTOM_FIELD_LABEL = 'Multiple Choice'; // REPLACE
    
        // output completely custom content
        $content = '<div class="oum_location_text">';
    
        foreach ($location['custom_fields'] as $key => $custom_field) {
            if($custom_field['label'] == $YOUR_CUSTOM_FIELD_LABEL) {
    
                // render multiple choice values as list
                $content .= '<ul>';
        
                foreach ($custom_field['val'] as $value) {
                    $content .= '<li>' . $value . '</li>';
                }
        
                $content .= '</ul>';
            }
        }
    
        $content .= '</div>';
    
        return $content;
    }, 10, 2);

    You can put this into the functions.php of your theme. Don’t forget to replace $YOUR_CUSTOM_FIELD_LABEL with your own.

    The code will completely replace the location bubble content with a list. So you’d probably want to adapt this to you needs. But it should be a good starting point.

    Best Regards,
    Daniel

    Thread Starter marko2002

    (@marko2002)

    Hi Daniel and thanks for the example here, unfortunately I can’t get it to work. In my example, the custom field results I want to have bullets on is called “Issues” and I’ve replaced “$YOUR_CUSTOM_FIELD_LABEL” with “$Issues”. From what I can see, there are only two instances of this in the code above, am I right in that or are there other instances of the custom field that require attention within the code you supplied.

    Many Thanks

    Plugin Author 100plugins

    (@100plugins)

    Hi @marko2002,

    No, maybe I explained it wrong.

    Just replace this line:

    $YOUR_CUSTOM_FIELD_LABEL = 'Multiple Choice';

    with

    $YOUR_CUSTOM_FIELD_LABEL = 'Issues';

    That’s all.

    Best Regards,
    Daniel

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bullet list on custom field options’ is closed to new replies.