Skip to content

Commit

Permalink
Forms: remove the rendering of the form from an empty block
Browse files Browse the repository at this point in the history
  • Loading branch information
enejb committed Jan 24, 2025
1 parent 9acfbe9 commit 0eca3cc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public static function register_child_blocks() {
* @return string
*/
public static function gutenblock_render_form( $atts, $content ) {
// If the user has not selected any type of form lets not display the default form but display nothing.
if ( empty( $atts ) && trim( $content ) === '<div class="wp-block-jetpack-contact-form"></div>' ) {
return '';
}

// We should not render block is module is disabled
if ( ! Jetpack::is_module_active( 'contact-form' ) ) {
return '';
Expand Down

0 comments on commit 0eca3cc

Please sign in to comment.