Display Form Title and Description on Edit

Code

Filename: gpeb-display-form-title-description-on-edit.php

<?php
/**
 * Gravity Perks // Entry Blocks // Display Form Title and Description on Edit
 * https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
 */
add_filter( 'gform_form_args', function( $form_args ) {

	$is_block = (bool) rgpost( 'gpeb_entry_id' );
	if ( ! $is_block ) {
		$is_block = class_exists( 'WP_Block_Supports' ) && rgar( WP_Block_Supports::$block_to_render, 'blockName' ) === 'gp-entry-blocks/edit-form';
		if ( ! $is_block ) {
			return $form_args;
		}
	}

	$form_args['display_title']       = true;
	$form_args['display_description'] = true;

	return $form_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.