Change Feed Priority When Using the Gravity Forms Add-On Framework

The Gravity Forms Add-On Framework is a great time-saver for developing your custom Gravity Forms functionality. In chatting with another developer, the question of adjusting the feed priority came up.

How can you control the order in which feeds are processed?

In this situation, they needed to save data in one feed and then use that data in another feed, so it was important that the feeds fire in a particular order.

If you’re using the Add-On Framework, you likely understand object-oriented programming concepts — especially inheritance — so this isn’t a difficult task at all. There are a few ways to handle this, but here’s a simple way:

public function init() {

			GFAddOn::init();

			add_filter( 'gform_entry_post_save', array( $this, 'maybe_process_feed' ), 9, 2 );

		}

Simply override the function that adds the filter to process the feed — GFFeedAddOn init — and add the filter with your desired priority.

In this example, we’re setting this particular Add-On’s feed to process *before* the ones with the default priority. It doesn’t affect the priority of any other Add-Ons.



Questions? Email Me