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?
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.
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?
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
+}