Skip to content

Commit 4062f64

Browse files
authored
Create gpeb-hide-empty-columns.html
1 parent f7ad758 commit 4062f64

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
* Gravity Perks // Entry Blocks // Hide Empty Columns on Edit
3+
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
4+
*
5+
* If you include multiple Entry Blocks on the same page and click to view or edit a single entry,
6+
* only the block to which that entry belongs will be visible. If you have each Entry Block displayed
7+
* in its own column, this will render any other column empty in these views.
8+
*
9+
* Use this snippet to automatically find empty columns and remove them, making the remaining column
10+
* full width.
11+
*
12+
* Instructions:
13+
*
14+
* 1. Add an HTML block to your page.
15+
* 2. Copy the snippet into that block.
16+
-->
17+
<script>
18+
document.querySelectorAll( '.wp-block-column' ).forEach( element => {
19+
if ( element.textContent.trim() === '' ) {
20+
element.remove();
21+
}
22+
} );
23+
</script>

0 commit comments

Comments
 (0)