gform_post_select_initial_count

Description

The gform_post_select_initial_count filter in Gravity Forms allows setting the default number of posts to retrieve when the Settings API renders a field of type post_select.

Usage

add_filter( 'gform_post_select_initial_count', 'your_function_name' );

Parameters

  • $count integer
    The number of posts to retrieve. Default value is 5.

Examples

This example sets the initial number of posts to 10.

add_filter( 'gform_post_select_initial_count', function( $count ) {
    return 10;
} );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

This filter was added in Gravity Forms version 2.6.2.

Source Code

This filter is located in GF_Settings_Config_Admin::data() in includes/settings/config/class-gf-settings-config-admin.php.