• Resolved Powerful1

    (@powerful1)


    I am trying to understand using placeholders. As a simple example, #_ATT{group}{men|women}.

    I want to use #_ATT{group}{men|women} to call information about two different groups. I want to identify the group using the custom attribute and then code the output into the shortcode.

    [events_list]#_EVENTNAME {has_group}{men}Has info about a group men{/has_group}{/men}{has_group}{women}Has info about a group of women{/has_group}{/women}[/events_list]

    I used this in my functions file

    // #_ATT{group}{men|women}
                case 'has_att_PayPal_Shortcode_for_GP':
                    if (is_array($EM_Event->event_attributes) && !empty($EM_Event->event_attributes['group']))
                        $replacement = preg_replace('/\{\/?has_att_group\}/', '', $match);
                    else
                        $replacement = '';
                    break;
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Powerful1

    (@powerful1)

    OR, I would be willing to code the text about each group into the functions file using a replacement, but I don’t know how to do that.

    The idea being that on my event I can choose men|women, but the output is set to:
    {has_att_group}#_ATT{group}{/has_att_group}

    But instead of display ‘men’ or ‘women’, I would get the information about the group. If anyone knows how to do that…I’d love to know.

    Cheers

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Just to confirm, are you using BuddyPress and wanted to get the group info? If yes, you might need to create additional placeholders or conditional placeholders to get the group details.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using custom placeholder input values to call information’ is closed to new replies.