• When I put the shortcode in the page content, it works fine. But when I put:

    <? echo “shortcode dude\n”; do_action(‘[constantcontactapi formid=”1″ lists=”5″]’); ?>

    I see “shortcode dude” displayed, but not the signup form. I tried using do_shortcode in place of do_action. The problem is, I have a lot of different contact lists in CC, so for the value of “lists” I want to use a PHP variable (which will be set from a URL parameter), so I can have one page template for all signups.

    https://wordpress.org/plugins/constant-contact-api/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter adherbst

    (@adherbst)

    Solved that problem, but I have another. For the shortcode, I didn’t put echo in front of do_shortcode. It should be:

    <? echo do_shortcode(‘[constantcontactapi formid=”1″ lists=”5″]’); ?>

    Now my problem is that it is replacing the contact’s email lists with the one from the form; I just want it to append it. Is that possible?

    Thread Starter adherbst

    (@adherbst)

    I inserted this in KWSConstantContact.php on line 190 and now it works:

    // Update the contact details
    if(is_array($data->lists) && is_array($existingContact->lists)) {
    $data->lists = array_merge($data->lists, $existingContact->lists);
    }
    $modifiedContact = $existingContact->update($data);

    It would be good to have a per-form option for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘do_shortcode/do_action for v 3.1.4?’ is closed to new replies.