Include Posts of a Custom Post Type in the Embed URL › Post/Page Rule

Code

Filename: gpls-include-cpt-in-embed-url-post-page-rule.php

<?php
/**
 * Gravity Perks // Nested Forms // Include Posts of a Custom Post Type in the Embed URL › Post/Page Rule
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 */
add_filter( 'gpls_rule_get_post_args', function( $args ) {
	// Change "my_custom_post_type" to the slug of your custom post type.
	$args['post_type'][] = 'my_custom_post_type';
	return $args;
} );

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.