Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    • Documentation
    • Support
    • Account

gppa_query_limit

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Change the query limit to 750 for all dynamically populated fields.
    2. Change the query limit to 750 for only the post object type.
    3. Change the query limit to 1000 for a specific field on a form.

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.

function example_increase_limit_to_750 ($query_limit) {
    return 750;
}

add_filter( 'gppa_query_limit', 'example_increase_limit_to_750' );

Change the query limit to 750 for only the post object type.

function example_increase_limit_to_750 ($query_limit, $object_type) {
    if ($object_type->id !== 'post') {
        return $query_limit;
    }

    return 750;
}

add_filter( 'gppa_query_limit', 'example_increase_limit_to_750', 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 #3 in form #1.

function example_increase_limit_to_1000 ($query_limit, $object_type) {
    return 1000;
}

add_filter( 'gppa_query_limit_1_3', 'example_increase_limit_to_1000', 10, 2 );

All Perks

  • GF Auto Login
  • GF Better User Activation
  • GF Blacklist
  • 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 Expand Textareas
  • GF File Upload Pro
  • GF Limit Checkboxes
  • GF Limit Choices
  • GF Limit Dates
  • GF Limit Submissions
  • GF Live Preview
  • GF Media Library
  • GF Multi-Page Navigation
  • GF Nested Forms
  • GF Pay Per Word
  • GF PayPal One-time Fee
  • GF Placeholder
  • GF Populate Anything
  • GF Post Content Merge Tags
  • GF Preview Submission
  • GF Price Range
  • GF Read Only
  • GF Reload Form
  • GF Terms Of Service
  • GF Unique ID
  • GF Word Count

Copyright © 2021 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Gravity Perks
    ▼
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    ▼
    • Documentation
    • Support
    • Account