gppa_query_limit
Description
Adjust the maximum number of results that can be returned in a GP Populate Anything query.
Usage
Apply to all applicable fields on all forms.
add_filter( 'gppa_query_limit', 'my_custom_function' );
Apply to all applicable fields on a specific form.
add_filter( 'gppa_query_limit_FORMID', 'my_custom_function' );
Apply to a specific field on a specific form.
add_filter( 'gppa_query_limit_FORMID_FIELDID', 'my_custom_function' );
Parameters
query_limit int
Query limit to be passed onto Object Type queries.
object_type GPPA_Object_Type
Current object type.
field GF_Field
The current field being populated.
Since
This filter is available since GP Populate Anything 1.0.
The $field
parameter and FORMID/FIELDID support was added in 1.0-beta-4.44.
Examples
Change the query limit to 750 for all dynamically populated fields.
<?php
/**
* Gravity Perks // GP Populate Anything // Change The Query Limit
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
add_filter( 'gppa_query_limit', function() {
// Update "750" to whatever you would like the query limit to be.
return 750;
} );
Change the query limit to 750 for only the post object type.
<?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 );
Change the query limit to 1000 for a specific field on a form.
In this example, we increase the query limit to 1,000 for field 4
in form 123
.
<?php
/**
* Gravity Perks // GP Populate Anything // Change Query Limit for a Specific Field
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
// Update "123" to your form ID and "4" to your field ID.
add_filter( 'gppa_query_limit_123_4', function( $query_limit, $object_type ) {
// Update "1000" to the maximum number of results that should be returned for the query populating this field.
return 1000;
}, 10, 2 );
All Connections
All Perks
- GF Address Autocomplete
- GF Advanced Calculations
- GF Advanced Phone Field
- GF Advanced Save & Continue
- GF Advanced Select
- GF Auto List Field
- GF Auto Login
- GF Better User Activation
- GF Blocklist
- GF Bookings
- GF Conditional Logic Dates
- GF Conditional Pricing
- GF Copy Cat
- GF Date Time Calculator
- GF Disable Entry Creation
- GF Easy Passthrough
- GF eCommerce Fields
- GF Email Users
- GF Email Validator
- GF Entry Blocks
- GF Expand Textareas
- GF File Renamer
- GF File Upload Pro
- GF Inventory
- GF Limit Checkboxes
- GF Limit Dates
- GF Limit Submissions
- GF Live Preview
- GF Media Library
- GF Multi-Page Navigation
- GF Nested Forms
- GF Notification Scheduler
- GF Page Transitions
- GF Pay Per Word
- GF Populate Anything
- GF Post Content Merge Tags
- GF Preview Submission
- GF Price Range
- GF QR Code
- GF Randomizer
- GF Read Only
- GF Reload Form
- GF Submit to Access
- GF Terms Of Service
- GF Unique ID
- GF Word Count