Description
Filter the field text (or label) for choice-based fields that are dynamically populated but have no available objects based on the current filters.
Usage
Filter the missing filter choice label for all fields.
add_filter( 'gppa_no_choices_text', 'my_custom_function' );
Parameters
label string
Default:
'– ' . esc_html__( 'No Results', 'gp-populate-anything' ) . ' –'
Choice label.
$field GF_Field
Current field.
Examples
Change “No Choices” text for a specific field
This generic example shows how you might target a specific field (1) on a specific form (36) to use a different bit of text if no results are found.
add_filter( 'gppa_no_choices_text', function ( $label, $field ) { if ( $field->formId == 36 and $field->id == 1 ) { $label = 'No Post(s) Found'; } return $label; }, 10, 2 );
Since
This filter is available since GP Populate Anything 1.0.