<?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: gform_filter_leads</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads</link>
		<description>Gravity Support Forums Topic: gform_filter_leads</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 16:16:39 +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/gform_filter_leads" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-244514</link>
			<pubDate>Thu, 09 May 2013 11:05:33 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">244514@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi squidgemann,&#60;/p&#62;
&#60;p&#62;Thanks for adding your voice to this request. This task has not yet come up in our queue; however, this forum post is listed in the task so we'll review it when we discuss and plan on how to best support this. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>squidgemann on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-244294</link>
			<pubDate>Thu, 09 May 2013 07:59:42 +0000</pubDate>
			<dc:creator>squidgemann</dc:creator>
			<guid isPermaLink="false">244294@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Plus 1 for a built-in hook to filter leads. &#60;/p&#62;
&#60;p&#62;To achieve this on my current project, I've replicated the entry_list and entry_detail pages in my theme, and then added a new page called &#34;leads&#34; using the gform_addon_navigation hook. I then process the info on that page and filter leads as appropriate. It does make the count redundant, but I'm not too bothered about that at this stage. I'm also increasing the leads-per-page using gform_entry_page_size to 99999 since volume isn't an issue in this case &#38;amp; I didn't want to run into the pagination issue.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-186952</link>
			<pubDate>Wed, 27 Mar 2013 17:09:03 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">186952@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Bristweb,&#60;/p&#62;
&#60;p&#62;The biggest issue I see with this offhand is that it does not work well with the pagination. If you filter out x number of leads, the pagination does not know how many leads were filtered out and will not be updated. This means you could have 200 leads but filter out 199 of them. The user would see there 1 lead but the pagination would indicate that there were 10 more pages of leads for them to view.&#60;/p&#62;
&#60;p&#62;I've added this topic to our task queue so that we will sit down and think of the best way to allow the filtering of leads. Thanks for the sample code and encouragement to look into this! :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-184122</link>
			<pubDate>Mon, 25 Mar 2013 12:40:40 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">184122@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks. I forwarded your suggestion to the development team.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bristweb on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-182301</link>
			<pubDate>Sat, 23 Mar 2013 19:57:27 +0000</pubDate>
			<dc:creator>bristweb</dc:creator>
			<guid isPermaLink="false">182301@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Since it is just a standard WordPress filter, it is very simple to get it working.  Like I said, I hope you add this to your release so others can benefit.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-181912</link>
			<pubDate>Sat, 23 Mar 2013 12:35:04 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">181912@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the code.  How is that working for you right now?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bristweb on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-178850</link>
			<pubDate>Thu, 21 Mar 2013 01:23:44 +0000</pubDate>
			<dc:creator>bristweb</dc:creator>
			<guid isPermaLink="false">178850@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Btw, here is a sample of how I've used the filter:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;public static function filter_leads($leads){
		if(!current_user_can(&#38;#39;remove_users&#38;#39;)){  // we want to filter leads for lower level users
			$user_client = get_usermeta(get_current_user_id(),&#38;#39;client&#38;#39;);
			$user_client = $user_client[0];
			foreach ($leads as $key =&#38;gt; $value) {
				$post = self::get_post_from_entry($value[id]);
				$post_client = get_post_meta(&#38;#39;client&#38;#39;,$post-&#38;gt;ID);
				$post_client = $post_client[0];
				if ($post_client-&#38;gt;ID != $user_client) {
					unset($leads[$key]);
				}
			}
		}
		return $leads;
	}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>bristweb on "gform_filter_leads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_filter_leads#post-178847</link>
			<pubDate>Thu, 21 Mar 2013 01:20:40 +0000</pubDate>
			<dc:creator>bristweb</dc:creator>
			<guid isPermaLink="false">178847@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've seen a few posts on this, but we really need it... so I built it.  The idea is to create a filter which lets developers restrict which leads / entries are returned to the user through the back end.  &#60;/p&#62;
&#60;p&#62;It could be used to divide forms by department, allow back end separation by client, or by form... whatever the dev wants.  Here are some sample topics:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/show-only-entries-from-a-field&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/show-only-entries-from-a-field&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/lead-generation-for-companies&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/lead-generation-for-companies&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/admin-entries-filters&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/admin-entries-filters&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Adding the filter is easy&#60;/p&#62;
&#60;p&#62;forms_model.php line ~2386 (immediately before return of &#60;code&#62;get_lead&#60;/code&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$leads = apply_filters(&#38;quot;gform_filter_leads&#38;quot;, $leads);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;forms_model.php line ~2488 (immediately before return of &#60;code&#62;get_leads&#60;/code&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$leads = apply_filters(&#38;quot;gform_filter_leads&#38;quot;, $leads);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Very easy change, very powerful results.&#60;/p&#62;
&#60;p&#62;The only slight issue is that this will interfere with the counts (all/unread/starred/trashed/spam)&#60;br /&#62;
There are a couple ways to handle.  You could put in a little more overhead and have the counts actually run the get_leads function.  Or you could just remove the counts (this is what I did since I don't think they add any value).&#60;/p&#62;
&#60;p&#62;entry_list.php line ~584&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;ul class=&#38;quot;subsubsub&#38;quot;&#38;gt;
-                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo empty($filter) ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot; ?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;All&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt; &#38;lt;span class=&#38;quot;count&#38;quot;&#38;gt;(&#38;lt;span id=&#38;quot;all_count&#38;quot;&#38;gt;&#38;lt;?php echo $active_lead_count ?&#38;gt;&#38;lt;/span&#38;gt;)&#38;lt;/span&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
-                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $read !== null ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=unread&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Unread&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt; &#38;lt;span class=&#38;quot;count&#38;quot;&#38;gt;(&#38;lt;span id=&#38;quot;unread_count&#38;quot;&#38;gt;&#38;lt;?php echo $unread_count ?&#38;gt;&#38;lt;/span&#38;gt;)&#38;lt;/span&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
-                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $star !== null ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=star&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Starred&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt; &#38;lt;span class=&#38;quot;count&#38;quot;&#38;gt;(&#38;lt;span id=&#38;quot;star_count&#38;quot;&#38;gt;&#38;lt;?php echo $starred_count ?&#38;gt;&#38;lt;/span&#38;gt;)&#38;lt;/span&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
+                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo empty($filter) ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot; ?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;All&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
+                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $read !== null ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=unread&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Unread&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
+                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $star !== null ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=star&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Starred&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
                     &#38;lt;?php
                     if(GFCommon::akismet_enabled($form_id)){
                         ?&#38;gt;
-                        &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $filter == &#38;quot;spam&#38;quot; ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=spam&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Spam&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt; &#38;lt;span class=&#38;quot;count&#38;quot;&#38;gt;(&#38;lt;span id=&#38;quot;spam_count&#38;quot;&#38;gt;&#38;lt;?php echo $spam_count ?&#38;gt;&#38;lt;/span&#38;gt;)&#38;lt;/span&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
+                        &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $filter == &#38;quot;spam&#38;quot; ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=spam&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Spam&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;lt;/a&#38;gt; &#124; &#38;lt;/li&#38;gt;
                         &#38;lt;?php
                     }
                     ?&#38;gt;
-                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $filter == &#38;quot;trash&#38;quot; ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=trash&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Trash&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt; &#38;lt;span class=&#38;quot;count&#38;quot;&#38;gt;(&#38;lt;span id=&#38;quot;trash_count&#38;quot;&#38;gt;&#38;lt;?php echo $trash_count ?&#38;gt;&#38;lt;/span&#38;gt;)&#38;lt;/span&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;
+                    &#38;lt;li&#38;gt;&#38;lt;a class=&#38;quot;&#38;lt;?php echo $filter == &#38;quot;trash&#38;quot; ? &#38;quot;current&#38;quot; : &#38;quot;&#38;quot;?&#38;gt;&#38;quot; href=&#38;quot;?page=gf_entries&#38;amp;view=entries&#38;amp;id=&#38;lt;?php echo $form_id ?&#38;gt;&#38;amp;filter=trash&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Trash&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;
                 &#38;lt;/ul&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I think this would be a great addition to the core and of course would save me from having to make the change on every update.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
