<?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 Topic: Filter gform_notification_email and global $post problem 1.5.rc3.4</title>
		<link>https://legacy.forums.gravityhelp.com/topic/filter-gform_notification_email-and-global-post-problem-15rc34</link>
		<description>Gravity Support Forums Topic: Filter gform_notification_email and global $post problem 1.5.rc3.4</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 07:45:42 +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/topic/filter-gform_notification_email-and-global-post-problem-15rc34" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Filter gform_notification_email and global $post problem 1.5.rc3.4"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/filter-gform_notification_email-and-global-post-problem-15rc34#post-16905</link>
			<pubDate>Mon, 24 Jan 2011 05:30:48 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">16905@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The global $post variable isn't loaded at that point yet (same problem as wp_loaded).&#60;br /&#62;
Do you have an issue with the &#34;wp&#34; hook?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pronamic on "Filter gform_notification_email and global $post problem 1.5.rc3.4"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/filter-gform_notification_email-and-global-post-problem-15rc34#post-16904</link>
			<pubDate>Mon, 24 Jan 2011 03:57:43 +0000</pubDate>
			<dc:creator>pronamic</dc:creator>
			<guid isPermaLink="false">16904@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is the 'init' action hook not a better choice? &#60;/p&#62;
&#60;p&#62;The {embed_post:*} variables are working, but they are always replaced with the homepage post fields.&#60;/p&#62;
&#60;p&#62;I guess the following code is causing this issue:&#60;/p&#62;
&#60;p&#62;common.php:466&#60;br /&#62;
&#60;a href=&#34;http://pastebin.com/w1H9uSr9&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/w1H9uSr9&#60;/a&#62;&#60;br /&#62;
$embed_posts = $query-&#38;gt;query($_SERVER[&#34;QUERY_STRING&#34;]);&#60;/p&#62;
&#60;p&#62;The $_SERVER[&#34;QUERY_STRING&#34;] is empty in my case and WordPress didn't parse the (global) query parameters. How should $query-&#38;gt;query load the correct post or page in that case?&#60;/p&#62;
&#60;p&#62;See also:&#60;br /&#62;
&#60;a href=&#34;http://forum.gravityhelp.com/topic/variable-embed_post-not-working-15rc34#post-16805&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/variable-embed_post-not-working-15rc34#post-16805&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Filter gform_notification_email and global $post problem 1.5.rc3.4"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/filter-gform_notification_email-and-global-post-problem-15rc34#post-16841</link>
			<pubDate>Sat, 22 Jan 2011 07:32:05 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">16841@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We did make a substantial change in Gravity Forms 1.5 that is causing this issue. Previously, the form processing (entry creation, notification, etc...) was being executed with the form rendering logic, very late in the WP life cycle. That worked well in most cases, except when handling confirmation redirects. Because the confirmation was handled so late in the process, the HTTP headers had already been sent and we weren't able to perform a real redirect. We were forced to fully load the page and perform a redirect via javascript, which caused some issues and annoyances for our users. That issue became an even bigger problem with the PayPal addon, that requires a redirect to PayPal.&#60;br /&#62;
We decided to fix that problem by moving the form processing code way up in the life cycle so that we could perform a real redirect.&#60;/p&#62;
&#60;p&#62;The wp_loaded hook seemed to be a good choice, but you do have a good point. I don't see a problem with the {embed_post:*} variables as they don't rely on the global $post variable and they seem to be working Ok. However, this does pose a problem for users that were relying on the global $post variable in their hooks. &#60;/p&#62;
&#60;p&#62;I have played around with different hooks, and it seems like the &#34;wp&#34; hook is a better choice. It happens early enough that the headers have not been sent yet, but the global $post variable is already available.&#60;br /&#62;
Send me an email to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62; if you would like to try it out.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pronamic on "Filter gform_notification_email and global $post problem 1.5.rc3.4"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/filter-gform_notification_email-and-global-post-problem-15rc34#post-16761</link>
			<pubDate>Fri, 21 Jan 2011 10:39:10 +0000</pubDate>
			<dc:creator>pronamic</dc:creator>
			<guid isPermaLink="false">16761@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In the topic &#60;a href=&#34;http://forum.gravityhelp.com/topic/sending-form-to-author-of-post&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/sending-form-to-author-of-post&#60;/a&#62; i see some examples of how to adjust the notification e-mailaddress. Unfortunately this does not work on WordPress 3.1-RC2-17315 and Gravity Forms 1.5.rc3.4.&#60;/p&#62;
&#60;p&#62;The global $post variable is in all cases 'null' within the 'gform_notification_email' filter.&#60;br /&#62;
&#60;a href=&#34;http://pastebin.com/qENCX4wy&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/qENCX4wy&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I guess this filter is not called within the WordPress loop (anymore?). I see that the processing of an form is executed within the 'wp_loaded' action.&#60;/p&#62;
&#60;p&#62;add_action('wp_loaded',  array('RGForms', 'maybe_process_form'));&#60;/p&#62;
&#60;p&#62;It looks like WordPress is parsing the query variables after executing the 'wp_loaded' action. Therefore it is not possible to use the global $post variable or the query variables. The wp() function (global $wp-&#38;gt;main()) function is executed after the 'wp_loaded' action. &#60;/p&#62;
&#60;p&#62;I have found a way to fix this problem, but now the wp() function wil be called twice:&#60;/p&#62;
&#60;p&#62;function notificationEmail($eMailAddress, $entry) {&#60;br /&#62;
	wp();&#60;/p&#62;
&#60;p&#62;	global $post;&#60;/p&#62;
&#60;p&#62;	if($post) {&#60;br /&#62;
		$eMailAddress = get_the_author_meta('user_email', $post-&#38;gt;post_author);&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;	return $eMailAddress;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;I guess it's not meant to be to call the wp() function twice. Why do you use the 'wp_loaded' action hook for processing the forms? I guess this issue is also causing troubles with the use of {embed_post:*} variables (&#60;a href=&#34;http://forum.gravityhelp.com/topic/variable-embed_post-not-working-15rc34)&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/variable-embed_post-not-working-15rc34)&#60;/a&#62;. It feels kind a buggy and not well thought out.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
