Title: Action Network embed code not accepted
Last modified: May 25, 2021

---

# Action Network embed code not accepted

 *  Resolved [Jeremy Malcolm](https://wordpress.org/support/users/jeremy-malcolm/)
 * (@jeremy-malcolm)
 * [5 years ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/)
 * Although this plugin used to be working fine, now when I try to import a new 
   action I get the error “This does not seem to be a valid Action Network embed
   code.” The embed code is this:
 * `<link href='https://actionnetwork.org/css/style-embed-v3.css' rel='stylesheet'
   type='text/css' /><script src='https://actionnetwork.org/widgets/v4/letter/demand-
   funding-for-the-treatment-and-prevention-of-sexual-assault?format=js&source=widget'
   ></script><div id='can-letter-area-demand-funding-for-the-treatment-and-prevention-
   of-sexual-assault' style='width: 100%'><!-- this div is the target for our HTML
   insertion --></div>`

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

 *  [valerielovelace2020](https://wordpress.org/support/users/valerielovelace2020/)
 * (@valerielovelace2020)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/#post-14572540)
 * Same issue here. Not recognized as a valid embed code.
 * And when, oh when will this tool be updated to include an option to EDIT once
   an action is created?
 *  Plugin Author [Concerted Action](https://wordpress.org/support/users/concertedaction/)
 * (@concertedaction)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/#post-14580253)
 * We won’t be adding the ability to edit and action in WordPress. You’ll always
   need to log into your Action Network account to do that.
 * We’ve been unable to replicate the error you both refer to. Any more information
   about what you were doing would be helpful.
 *  Thread Starter [Jeremy Malcolm](https://wordpress.org/support/users/jeremy-malcolm/)
 * (@jeremy-malcolm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/#post-14593856)
 * Nothing weird or complicated. I’m literally just copying the embed code and pasting
   it and getting the “This does not seem to be a valid Action Network embed code”
   error. I tried it again just now with a new Action Network action that I just
   created. What else do you want me to do to debug it?
 *  Thread Starter [Jeremy Malcolm](https://wordpress.org/support/users/jeremy-malcolm/)
 * (@jeremy-malcolm)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/#post-14593944)
 * OK, I found the problem. Action Network incremented a version string from v3 
   to v4, and your code couldn’t parse it. This patch fixes the problem:
 *     ```
       --- actionnetwork.php.dist      2021-06-24 21:27:11.530821901 +0000
       +++ actionnetwork.php   2021-06-24 21:49:36.332550718 +0000
       @@ -999,8 +999,8 @@
                                       $event['modified_date'] = (int) current_time('timestamp');
   
                                       // parse embed code
       -                               $embed_style_matched = preg_match_all("/<link href='https:\/\/actionnetwork\.org\/css\/style-embed(-whitelabel)?\.css' rel='stylesheet' type='text\/css' \/>/", $embed_code, $embed_style_matches, PREG_SET_ORDER);
       -                               $embed_script_matched = preg_match_all("|<script src='https://actionnetwork\.org/widgets/v[2-3]/([a-z_]+)/([-a-z0-9]+)\?format=js&source=widget(&style=full)?'>|", $embed_code, $embed_script_matches, PREG_SET_ORDER);
       +                               $embed_style_matched = preg_match_all("/<link href='https:\/\/actionnetwork\.org\/css\/style-embed(-whitelabel)?-v3\.css' rel='stylesheet' type='text\/css' \/>/", $embed_code, $embed_style_matches, PREG_SET_ORDER);
       +                               $embed_script_matched = preg_match_all("|<script src='https://actionnetwork\.org/widgets/v[2-4]/([a-z_]+)/([-a-z0-9]+)\?format=js&source=widget(&style=full)?'>|", $embed_code, $embed_script_matches, PREG_SET_ORDER);
                                       $embed_style = $embed_style_matched ? ( isset($embed_style_matches[0][1]) && $embed_style_matches[0][1] ? 'layout_only' : 'default' ) : 'no';
                                       $embed_size = isset($embed_script_matches[0][3]) && $embed_script_matches[0][3] ? 'full' : 'standard';
                                       $embed_field_name = 'embed_'.$embed_size.'_'.$embed_style.'_styles';
       @@ -1128,7 +1128,7 @@
   
                       // parse embed code
                       $embed_style_matched = preg_match_all("/<link href='https:\/\/actionnetwork\.org\/css\/style-embed(-whitelabel)?\.css' rel='stylesheet' type='text\/css' \/>/", $embed_code, $embed_style_matches, PREG_SET_ORDER);
       -               $embed_script_matched = preg_match_all("|<script src='https://actionnetwork\.org/widgets/v[2-3]/([a-z_]+)/([-a-z0-9]+)\?format=js&source=widget(&style=full)?'>|", $embed_code, $embed_script_matches, PREG_SET_ORDER);
       +               $embed_script_matched = preg_match_all("|<script src='https://actionnetwork\.org/widgets/v[2-4]/([a-z_]+)/([-a-z0-9]+)\?format=js&source=widget(&style=full)?'>|", $embed_code, $embed_script_matches, PREG_SET_ORDER);
   
                       $embed_style = $embed_style_matched ? ( isset($embed_style_matches[0][1]) && $embed_style_matches[0][1] ? 'layout_only' : 'default' ) : 'no';
                       $embed_type = isset($embed_script_matches[0][1]) ? $embed_script_matches[0][1] : '';
       @@ -1892,4 +1892,4 @@
                       echo $result;
                       wp_die();
               }
       -}
       \ No newline at end of file
       +}
       ```
   

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

The topic ‘Action Network embed code not accepted’ is closed to new replies.

 * ![](https://ps.w.org/wp-action-network/assets/icon-256x256.png?rev=1688408)
 * [Action Network](https://wordpress.org/plugins/wp-action-network/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-action-network/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-action-network/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-action-network/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-action-network/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-action-network/reviews/)

## Tags

 * [invalid code](https://wordpress.org/support/topic-tag/invalid-code/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jeremy Malcolm](https://wordpress.org/support/users/jeremy-malcolm/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/action-network-embed-code-not-accepted/#post-14593944)
 * Status: resolved