Change Query Limit for a Specific Object Type

Code

Filename: gppa-change-query-limit-for-post-object.php

<?php
/**
 * Gravity Perks // Populate Anything // Change Query Limit for a Specific Object Type
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_query_limit', function( $query_limit, $object_type ) {
	// Update "post" to your the object for which you would like to increase the limit.
	if ( $object_type->id === 'post' ) {
		// Update "750" to the number of results to return for this object type.
		$query_limit = 750;
	}
	return $query_limit;
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.