jasoncfoster
Forum Replies Created
-
Forum: Plugins
In reply to: [Gravity Forms: Force SSL] Too many shortcodes on page won't redirectI also had to change the force_ssl() method as we are using some rewrite rules and wanted to maintain our url formatting.
function force_ssl( $post_id = null ){ if( is_admin() ) return; $goto = 'https://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; wp_redirect( $goto, 301 ); exit; }Forum: Plugins
In reply to: [Gravitate Gforms API Helper] Need access to entry idWe had to circumvent using the hook anyway so not a big deal. Our backend provider was taking too long to respond to the submission so we created a separate process to grab entries and submit them out of band with the site visitor. Closest we could get to async with our host and PHP.
The main thing we’re using the plugin for now is the additional form meta for finding the correct field id based on the ggah name.
Anyway, thanks for all the help.
Forum: Plugins
In reply to: [Gravitate Gforms API Helper] Not passing the value "0"Totally makes sense and it might be best to add that additional property to the field. I was just saying that in order to keep the functionality as close to what you had before you would want to not use isset() to test $vvalue because the behavior is very different than what you had with empty().
Thanks for spending time thinking through this. I don’t know how many other people are needing this type of thing but it’s a huge lifesaver for us. Mapping to an API is hard enough without adding the GF naming convention for fields into the mix. We’ll have several forms that will all end up mapping identically with your plugin.
Forum: Plugins
In reply to: [Gravitate Gforms API Helper] Not passing the value "0"We have a ton of conditional fields in our forms so we often have no value set for various entry fields. With the logic on line 88 which checks isset() and then either sets the $value to the value of the field or it sets $value to ” which will now be true in the isset($value) that you changed to from empty($value).
In fact, due to some conditions we were successfully sending different fields to the same $data element due to the others being unset. I believe the changes I recommended still meet your overall design philosophy with just a tweak to support numeric 0 values to be passed through.
My $0.02.
Forum: Plugins
In reply to: [Gravitate Gforms API Helper] Not passing the value "0"I might have spoken too soon. I think using isset() is always true now because of line 88 which causes all fields to be passed along even if empty. Instead of empty() or isset() I created an is_blank() test which takes numeric values of 0 into account. I’m not a seasoned PHP dev by any means so I didn’t know of a built-in function that would work. I found is_blank() on the codex for empty() in the user contributions.
Line 99:
if(!empty($field[‘ggah_’.str_replace(‘-‘, ‘_’, $api).’_field’]) && !empty($field[‘id’]) && !is_blank($value))Added function is_blank:
function is_blank($value) {
return empty($value) && !is_numeric($value);
}This gets what you were originally after. Sorry I didn’t notice immediately but we had some tests going on that showed the issue.
Forum: Plugins
In reply to: [Gravitate Gforms API Helper] Not passing the value "0"Works great! Thanks for the quick update!
Forum: Plugins
In reply to: [Widget Wrangler] Error cloning WP widgetsThanks for the quick response and sorry for late reply…
It was a custom widget created as a custom plugin. It’s very possible that the plugin was not constructed correctly which could wreak all sorts of havoc on your code.
Go ahead and close this as we’ve determined we really want to start from scratch on those widgets instead of carrying over any original custom stuff.