Hide Post And Taxonomy Term as Population Options

Code

Filename: gppa-hide-post-taxonomy-population-options.php

<?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 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.