File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Gravity Perks // Entry Blocks // Single Page Edit
4+ * https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
5+ *
6+ * Remove page breaks from Entry Blocks edit form.
7+ */
8+ add_filter ( 'gform_pre_render ' , function ( $ form ) {
9+
10+ $ is_block = (bool ) rgpost ( 'gpeb_entry_id ' );
11+ if ( ! $ is_block ) {
12+ $ is_block = class_exists ( 'WP_Block_Supports ' ) && rgar ( WP_Block_Supports::$ block_to_render , 'blockName ' ) === 'gp-entry-blocks/edit-form ' ;
13+ if ( ! $ is_block ) {
14+ return $ form ;
15+ }
16+ }
17+
18+ $ fields = array ();
19+
20+ foreach ( $ form ['fields ' ] as $ field ) {
21+ if ( $ field ->type !== 'page ' ) {
22+ $ fields [] = $ field ;
23+ }
24+ }
25+
26+ $ form ['fields ' ] = $ fields ;
27+
28+ return $ form ;
29+ } );
You can’t perform that action at this time.
0 commit comments