gppa_autoloaded_object_types

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Hide Post And Taxonomy Term as Population Options
  5. Since

Description

Filter object types GPPA will populate from.

Usage

add_filter( 'gppa_autoloaded_object_types', 'my_custom_function' );

Parameters

  • $object_types array

    Array of GPPA object types indexed by type name. Default value:

    array( 'post'     => 'GPPA_Object_Type_Post',
           'term'     => 'GPPA_Object_Type_Term',
           'user'     => 'GPPA_Object_Type_User',
           'gf_entry' => 'GPPA_Object_Type_GF_Entry',
           'database' => 'GPPA_Object_Type_Database');

Examples

Hide Post And Taxonomy Term as Population Options

<?php
/**
 * Gravity Perks // GP Populate Anything // Hide Post And Taxonomy Term as Population Options
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_autoloaded_object_types', function ( $object_types ) {
	foreach ( $object_types as $key => $value ) {
		if ( in_array( $key, array( 'post', 'term' ) ) ) {
			unset( $object_types[ $key ] );
		}
	}
	return $object_types;
}, 10, 1 );

Since

This filter is available since Gravity Forms Populate Anything 1.0-beta-4.104.