<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Tag: hooks - Recent Topics</title>
		<link>https://legacy.forums.gravityhelp.com/tags/hooks</link>
		<description>Gravity Support Forums Tag: hooks - Recent Topics</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 21:42:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/tags/hooks/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>donnacha on "Bookings, Appointments, Reservations and Rentals"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bookings-appointments-reservations-and-rentals#post-23906</link>
			<pubDate>Thu, 21 Apr 2011 22:55:03 +0000</pubDate>
			<dc:creator>donnacha</dc:creator>
			<guid isPermaLink="false">23906@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;For the past few years, I've been keeping an eye on the booking options within the WordPress universe and, frankly, I am astonished that still, in 2011, there aren't any realistic products.&#60;/p&#62;
&#60;p&#62;The few that do exist have no thought or style behind them, are poorly supported, ridiculously inflexible, rarely updated, insanely priced and foist horrible design and formatting decisions upon you.&#60;/p&#62;
&#60;p&#62;The net effect it that there are no real booking options on WordPress and the received wisdom is that, if you want that sort of functionality, you've got to go and get your hands dirty with Joomla or Drupal.&#60;/p&#62;
&#60;p&#62;I don't see any technical reason why booking functionality should not be just as possible on WordPress, I suspect the problem is that WordPress developers have traditionally had blind-spot for this huge market, they simply don't yet get how massive the demand is, despite the never-ending stream of people searching and asking about it on forums.&#60;/p&#62;
&#60;p&#62;What we are talking about is the ability for the user to:&#60;/p&#62;
&#60;p&#62;1. View a calendar showing what dates are currently available.&#60;/p&#62;
&#60;p&#62;2. Choose a date or range of dates.&#60;/p&#62;
&#60;p&#62;3. Pay for that slot.&#60;/p&#62;
&#60;p&#62;4. Have those dates immediately become unavailable to others.&#60;/p&#62;
&#60;p&#62;5. Receive an email notification.&#60;/p&#62;
&#60;p&#62;... no other bells, whistles or fancy formatting required, leave it entirely up to the post to describe and depict what that bookable item is, just give us that bookability.&#60;/p&#62;
&#60;p&#62;It doesn't matter if we are talking about babysitters, photographers, language lessons via Skype, vacation apartments, hookers or xbox rentals; it doesn't matter if you want the user to pay a 10% deposit or the full amount; it doesn't matter if you have one bookable item or thousands ... a plugin that can handle those five basic steps will be universally useful.&#60;/p&#62;
&#60;p&#62;It is as if we are in the stone age of the Internet - how many millions of man hours are wasted every year as customers submit enquiry forms and wait for businesses to check their schedules and reply by hand?  How many transactions end up not happening simply because we've got humans doing what it would be trivial for computers to do?  It's crazy!&#60;/p&#62;
&#60;p&#62;If you think about it, this would be the perfect extension for what Gravity Forms already does and I know that RockGenius would implement it well and, unlike existing &#34;solutions&#34;, would keep it simple, allowing WordPress to handle the content side of the equation, allowing us to decide what damn photo-slider we want to use.&#60;/p&#62;
&#60;p&#62;I truly believe that no other Gravity Forms feature could have as much impact.  At a stroke, it would pull the (extremely lucrative) market for bookings, appointments, reservations and rentals right out from under the existing systems that people are forced to use and bring that entire sector over to Gravity Forms and WordPress.&#60;/p&#62;
&#60;p&#62;And how many new forms of commerce and interaction will spring up if you put the power of running a simple booking system into the hands of regular WordPress users, easier and cheaper than it has ever been before?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Coen Jacobs on "Populating from and writing to external database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-from-and-writing-to-external-database#post-6402</link>
			<pubDate>Wed, 16 Jun 2010 16:35:17 +0000</pubDate>
			<dc:creator>Coen Jacobs</dc:creator>
			<guid isPermaLink="false">6402@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm working on a project and we're about to decide wether or not use GF for the job. Main concern is populating fields from an external database and write user input to the same external database. I've never done this before and I really don't know what's possible with GF and controlling external databases.&#60;/p&#62;
&#60;p&#62;There are possibilities to use GF-hooks and custom plugins, but I'm not sure if I'm able to alter what GF will do with the user input. And, even more important, are we able to hook into GF saving the contents/fields of a form so we can adjust the structure of the external database to it?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lavalleecreative on "Create DB Record in Third Party Plugin Table from New User Registration Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/create-db-record-in-third-party-plugin-table-from-new-user-registration-form#post-251497</link>
			<pubDate>Mon, 13 May 2013 20:46:57 +0000</pubDate>
			<dc:creator>lavalleecreative</dc:creator>
			<guid isPermaLink="false">251497@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I’m looking for a method to automatically create a new record in the Store Locator plugin (&#60;a href=&#34;http://www.charlestonsw.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.charlestonsw.com/&#60;/a&#62;) when a new user signs up via a Gravity Forms user registration form on the site (&#60;a href=&#34;http://www.mnla.com&#34; rel=&#34;nofollow&#34;&#62;http://www.mnla.com&#60;/a&#62;). Using the Gravity Forms action hook and function below, I should (I think) be able to produce insertion of a new Store Locator item. This code snippet is included in my functions.php file. What I am getting in Store Locator is a new record, but with none of the data entered.&#60;/p&#62;
&#60;p&#62;Do you see anything in here that looks incorrect? Is there another way I might go about doing this?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Add data to Store Locator
add_action(&#38;quot;gform_after_submission_1&#38;quot;, &#38;quot;input_fields&#38;quot;, 10, 2);
function input_fields($entry, $form){
    global $wpdb;
	$store = $entry[&#38;quot;5&#38;quot;];
	$address = $entry[&#38;quot;17.1&#38;quot;];
	$address2 = $entry[&#38;quot;17.2&#38;quot;];
	$city = $entry[&#38;quot;17.3&#38;quot;];
	$state = $entry[&#38;quot;17.4&#38;quot;];
	$zip = $entry[&#38;quot;17.5&#38;quot;];
	$email = $entry[&#38;quot;16.1&#38;quot;];
	$url = $entry[&#38;quot;8&#38;quot;];
	$phone = $entry[&#38;quot;6&#38;quot;];
   $SQL = &#38;quot;INSERT INTO wp_store_locator ( sl_id, sl_store, sl_address, sl_address2, sl_city, sl_state, sl_zip, sl_email, sl_url, sl_phone ) VALUES ( &#38;#39;&#38;#39;, &#38;#39;$store&#38;#39; , &#38;#39;$address&#38;#39;, &#38;#39;$address2&#38;#39;, &#38;#39;$city&#38;#39;, &#38;#39;$state&#38;#39;, &#38;#39;$zip&#38;#39;, &#38;#39;$email&#38;#39;, &#38;#39;$url&#38;#39;, &#38;#39;$phone&#38;#39; )&#38;quot;;
   $wpdb-&#38;gt;query($SQL);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cgrymala on "Adding New Fields With PHP"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-new-fields-with-php#post-245332</link>
			<pubDate>Thu, 09 May 2013 22:17:34 +0000</pubDate>
			<dc:creator>cgrymala</dc:creator>
			<guid isPermaLink="false">245332@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am trying to set up a form (integrated with Authorize.net) that will basically act as a &#34;checkout&#34; for an order form I need to set up. The order form will have anywhere from 100-500 different options, but each customer will probably never choose more than 5 of them at any time.&#60;/p&#62;
&#60;p&#62;Because of the nature of the items on the order form (they change extremely regularly), I have to generate that initial order form dynamically (outside of Gravity Forms).&#60;/p&#62;
&#60;p&#62;Basically, once the user submits that initial form, I want to dynamically add a new hidden product field for each product they chose to the Gravity Form used for checkout.&#60;/p&#62;
&#60;p&#62;Which filters/actions do I need to hook into in order to add these hidden product fields dynamically? &#60;/p&#62;
&#60;p&#62;I assume I'll have to hook into the gform_pre_render filter in order to add the hidden fields to the form itself when it's loaded on the front-end, but what other filters do I need to hook into in order to make sure those product choices are stored in the database, sent appropriately to Authorize.net, and included in any notification emails that are sent? &#60;/p&#62;
&#60;p&#62;Also, is there any documentation on the structure of hidden product fields so that I know what information to add to the form object? Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>magicdust on "Change Notification {admin_email} for From Address"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/change-notification-admin_email-for-from-address#post-232014</link>
			<pubDate>Wed, 01 May 2013 08:27:52 +0000</pubDate>
			<dc:creator>magicdust</dc:creator>
			<guid isPermaLink="false">232014@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;We set up gravity forms for a lot of our clients, however our normal Wordpress install the client usually uses an editor-level account and we handle the admin account. This is to prevent our often very low-tech clients from doing things that will break their site.&#60;/p&#62;
&#60;p&#62;The problem we're having is that although we do try to tell them not to, they're often leaving the From and To fields in their Notifications as {admin_email}. This is a problem because that email address is our email address, not theirs.&#60;/p&#62;
&#60;p&#62;I've looked up the gform_notification hook, and got it working so that if the notification has the text {admin_email} it replaces it with the email address of their account.&#60;/p&#62;
&#60;p&#62;The problem is that this doesn't seem to work on the From field. Is there a way in Gravity Forms to filter the From email address, so that I can replace it with theirs if they haven't manually changed it in the Form Settings?&#60;/p&#62;
&#60;p&#62;I'll be using 1.7 only from now on, so 1.7 filters are fine.&#60;/p&#62;
&#60;p&#62;My code so far (in a custom plugin for stuff like this):&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function gform_notification_email( $notification, $email, $form) {
	$editor = get_userdata( 2 );
	$notification = str_replace( &#38;#39;{admin_email}&#38;#39;, $editor-&#38;gt;user_email, $notification);
	return $notification;
}

add_filter(&#38;#39;gform_notification&#38;#39;, &#38;#39;gform_notification_email&#38;#39;, 10, 3);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Cheers,&#60;/p&#62;
&#60;p&#62;Jacob @ magicdust&#60;/p&#62;
&#60;p&#62;Edit: Sorry, I should note, that simply doing this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$notification[&#38;#39;from&#38;#39;] = $editor-&#38;gt;user_email;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Works just fine. However this will overwrite it even if the user changes it. I'd like to preserve whatever's in there, unless it's {admin_email}. Problem is it looks like that even though {admin_email} is what's in the notification settings, it's not actually included in the $notifications array.&#60;/p&#62;
&#60;p&#62;Edit: Ok, It seems just checking if $notification['from] == '' is working. Is there anything wrong with this approach? Are there any other places the admin email address is used I should watch out for?&#60;/p&#62;
&#60;p&#62;I know I've pretty much solved the problem... already, but I'm not super-confident in my solution. So if there's a better way, I'd love to hear it.&#60;/p&#62;
&#60;p&#62;Cheers!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>davethackeray on "Gravity Forms and Sugar CRM Community Edition - any chance of a plugin?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gravity-forms-and-sugar-crm-community-edition-any-chance-of-a-plugin#post-5341</link>
			<pubDate>Sun, 09 May 2010 16:29:36 +0000</pubDate>
			<dc:creator>davethackeray</dc:creator>
			<guid isPermaLink="false">5341@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey!&#60;/p&#62;
&#60;p&#62;I use Sugar CRM Community Edition because a. It's ace, and b. It's free.&#60;/p&#62;
&#60;p&#62;I'd like to be able to use my Gravity Form to send data into my Sugar CRM installation.&#60;/p&#62;
&#60;p&#62;I see Joost has done something similar with Salesforce.com but I can't afford their prices. And Sugar CRM does more than enough for me - as I'm sure it would for many other GF users.&#60;/p&#62;
&#60;p&#62;Any chance of an addon?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>g0shu4 on "Change user role after completing form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/cange-user-role-after-completing-form#post-37820</link>
			<pubDate>Thu, 13 Oct 2011 12:58:08 +0000</pubDate>
			<dc:creator>g0shu4</dc:creator>
			<guid isPermaLink="false">37820@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm working on a site where I have a form that includes a liability waiver and rules. I'm using the members plugin for role management. I'd like to change a user's role automatically once they have completed the form. Is this possible?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Contexture on "Adding data attributes to select/dropdown elements..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-data-attributes-to-selectdropdown-elements#post-195598</link>
			<pubDate>Wed, 03 Apr 2013 13:14:18 +0000</pubDate>
			<dc:creator>Contexture</dc:creator>
			<guid isPermaLink="false">195598@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm using the &#60;code&#62;gform_pre_render_{$int}&#60;/code&#62; hook to programmatically populate one of my drop-downs. In the hooked function, I have the following within a loop...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$field[&#38;#39;choices&#38;#39;][] = array(
    &#38;#39;text&#38;#39;  =&#38;gt; &#38;quot;{$date} &#38;amp;mdash; {$event-&#38;gt;post_title}, {$meta1}&#38;quot;,
    &#38;#39;value&#38;#39; =&#38;gt; $event-&#38;gt;post_name,
);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That works fine as-is, but I also need to add some &#60;code&#62;data-&#60;/code&#62; attributes for the sake of some custom Javascript... BUT... Gravity Forms doesn't seem to offer any hooks or options whatsoever for adding additional attributes. Adding &#60;code&#62;&#38;#39;data-mydata&#38;#39; =&#38;gt; $myValue&#60;/code&#62; does nothing.&#60;/p&#62;
&#60;p&#62;I went digging through GF to se if there was somewhere I might be able to hook in, but can't find a thing. I believe &#60;code&#62;GFCommon::get_select_choices()&#60;/code&#62; is the method that handles individual choices, and it contains no hooks or handling for array keys other than those that are hard-coded. What I believe is needed is some changes to GF. &#60;/p&#62;
&#60;p&#62;This is what I propose...&#60;/p&#62;
&#60;p&#62;Any entry under the 'choices' array should allow an associative sub-array called 'attributes'... that should then be parsed and outputted into the element, allowing developers to do something like this...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$field[&#38;#39;choices&#38;#39;][] = array(
    &#38;#39;text&#38;#39;  =&#38;gt; &#38;quot;{$date} &#38;amp;mdash; {$event-&#38;gt;post_title}, {$meta1}&#38;quot;,
    &#38;#39;value&#38;#39; =&#38;gt; $event-&#38;gt;post_name,
    &#38;#39;attributes&#38;#39; =&#38;gt; array(
        &#38;#39;data-mydata&#38;#39; =&#38;gt; $myValue,
    ),
);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Parsing associative arrays into attributes is as easy as using something like this (a method I wrote as part of a WordPress-centric HTML generator):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/**
 * Turns an associative array into HTML-ready attribute-value pairs.
 *
 * Any array values which are also arrays are turned into space-delimited
 * word values (in the vein of the CSS classes).
 *
 * @param array $atts An associative array of attributes and values.
 * @return string Attribute-value pairs ready to be used in an HTML element.
 */
public static function generate_atts($atts)
{
    $return=&#38;#39;&#38;#39;;
    foreach($atts as $att=&#38;gt;$val) {
        if ( is_array($val) &#124;&#124; is_object($val) ) {
            $return .= sprintf( &#38;#39;%s=&#38;quot;%s&#38;quot; &#38;#39;,
                sanitize_title_with_dashes($att),
                esc_attr( implode($val,&#38;#39; &#38;#39;) )
            );
        }
        else {
            $return .= sprintf( &#38;#39;%s=&#38;quot;%s&#38;quot; &#38;#39;,
                sanitize_title_with_dashes($att),
                esc_attr($val)
            );
        }
    }
    return $return;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Finally, &#60;code&#62;get_select_choices()&#60;/code&#62; (and any other methods that generate HTML)  would need to be updated like so...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$attributes = (isset($choice[&#38;#39;attributes&#38;#39;]) &#38;amp;&#38;amp; is_array($choice[&#38;#39;attributes&#38;#39;]) )
    ? generate_atts($choice[&#38;#39;attributes&#38;#39;])
    : &#38;#39;&#38;#39;;

$choices.= sprintf(&#38;quot;&#38;lt;option value=&#38;#39;%s&#38;#39; %s %s&#38;gt;%s&#38;lt;/option&#38;gt;&#38;quot;, esc_attr($field_value), $attributes, $selected,  esc_html($choice[&#38;quot;text&#38;quot;]));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If there is another way for me to do this, I'd love to hear it... otherwise, I may need to modify GF core (as shown above) to get this functionality as it's mission critical to my current project. It's simple enough and I've tested it and it works... but if I have to modify core, I'd really want to make sure that the functionality gets incorporated into the next GF release so that my forms don't break if someone updates the GF plugin.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dashaluna on "User Registration 1.5beta1 - one feed for registering and editing profile"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-15beta1-one-feed-for-registering-and-editing-profile#post-161982</link>
			<pubDate>Wed, 06 Mar 2013 09:58:41 +0000</pubDate>
			<dc:creator>dashaluna</dc:creator>
			<guid isPermaLink="false">161982@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I was wondering if it's possible to use the same User Registration feed form for both registering and editing details of already registered users.&#60;/p&#62;
&#60;p&#62;I've got:&#60;br /&#62;
1. A Register form.&#60;br /&#62;
2. A User Registration feed with the action &#34;Create User&#34; that uses the Register form.&#60;br /&#62;
3.  A Custom Registration Page is Enabled &#38;amp; that page has got Gravity Form shortcode to Registe form.&#60;/p&#62;
&#60;p&#62;Now, after a registration a user is redirected to an account page. Is there a way to use the same user registration feed, but make it pre-populated with user data and make it of action &#34;Update User&#34;. Can this be done via hooks?&#60;/p&#62;
&#60;p&#62;If not what's the best way to do it?&#60;/p&#62;
&#60;p&#62;Many thanks, Dasha&#60;/p&#62;
&#60;p&#62;WP: 3.5.1&#60;br /&#62;
Gravity Forms: 1.6.12&#60;br /&#62;
User Registration Add-on: 1.5beta1
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Deepend on "Can I change the order that hooks fire?  Or is there a list of when hooks fire?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-i-change-the-order-that-hooks-fire-or-is-there-a-list-of-when-hooks-fire#post-88583</link>
			<pubDate>Wed, 07 Nov 2012 22:47:14 +0000</pubDate>
			<dc:creator>Deepend</dc:creator>
			<guid isPermaLink="false">88583@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I am creating dynamic XML data inside gform_postsubmission which i need to call on the confirmation page. For this I have been trying to use gform_confirmation .&#60;/p&#62;
&#60;p&#62;But gform_confirmation fires after postsubmission....  This seems illogical to me, shouldn't confirmation fire after the form is submitted??&#60;/p&#62;
&#60;p&#62;Is there a way to modify this behaviour? &#60;/p&#62;
&#60;p&#62;Or is there a more appropriate set of hooks to use that will fire in order to create dynamic data, the retrieve it and display it in a confirmation page?&#60;/p&#62;
&#60;p&#62;A chronological list of when hooks fire would be very nice.&#60;/p&#62;
&#60;p&#62;Any help would be much appreciated, we have lost days over this now.&#60;/p&#62;
&#60;p&#62;Regards.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
