Skip to content

Commit eea69c8

Browse files
committed
Fixes PR requests
1 parent c4a6ff7 commit eea69c8

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

assets/js/gutenblock.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,12 @@
174174
* Create the div container, add an overlay so the user can interact
175175
* with the form in Gutenberg, then render the iframe with form
176176
*/
177-
if( '' === formID ) {
177+
if ( '' === formID ) {
178178
children.push( el( 'div', {style : {width: '100%'}},
179179
el( 'img', { className: 'weforms-block-logo', src: weFormsBlock.block_logo}),
180180
el ( 'div', null, 'weForms Forms'),
181181
inputFilterMain
182182
) );
183-
} else if( '0' === weFormsBlock.did_wp_head_run ) {
184-
children.push(
185-
el( 'div', { className: 'weforms-iframe-container' },
186-
el( 'div', { className: 'weforms-iframe-overlay' } ),
187-
el( 'span', null, 'Currently weForm is not able to be previewed in the Block-Based page builder. To preview use the page preview button after saving.' ),
188-
)
189-
)
190183
} else {
191184
children.push(
192185
el( 'div', { className: 'weforms-iframe-container' },

includes/admin/class-gutenblock.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,14 @@ public function weforms_form_block() {
5959

6060
$block_logo = WEFORMS_ASSET_URI . '/images/icon-weforms.png';
6161
$thumbnail_logo = WEFORMS_ASSET_URI . '/images/icon-weforms.png';
62-
$did_wp_head_run = did_action( 'wp_head' );
6362

64-
wp_localize_script( 'weforms-forms-block', 'weFormsBlock', [
63+
wp_localize_script( 'weforms-forms-block', 'weFormsBlock', array(
6564
'forms' => $forms,
6665
'siteUrl' => get_home_url(),
6766
'block_logo' => $block_logo,
6867
'thumbnail_logo' => $thumbnail_logo,
6968
'did_wp_head_run' => $did_wp_head_run,
70-
] );
69+
) );
7170
wp_enqueue_style( 'weforms-forms-block-style' );
7271
wp_enqueue_style( 'weforms-forms-block-editor' );
7372
}

includes/class-form-preview.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ public function __construct() {
6161
$this->form_id = isset( $_GET['form_id'] ) ? intval( $_GET['form_id'] ) : 0;
6262
}
6363

64-
add_action( 'pre_get_posts', [ $this, 'pre_get_posts' ] );
65-
add_filter( 'the_title', [ $this, 'the_title' ] );
66-
add_filter( 'the_content', [ $this, 'the_content' ] );
67-
add_filter( 'get_the_excerpt', [ $this, 'the_content' ] );
68-
add_filter( 'home_template_hierarchy', [ $this, 'use_page_template_hierarchy' ] );
69-
add_filter( 'frontpage_template_hierarchy', [ $this, 'use_page_template_hierarchy' ] );
64+
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
65+
add_filter( 'the_title', array( $this, 'the_title' ) );
66+
add_filter( 'the_content', array( $this, 'the_content' ) );
67+
add_filter( 'get_the_excerpt', array( $this, 'the_content' ) );
68+
add_filter( 'home_template_hierarchy', array( $this, 'use_page_template_hierarchy' ) );
69+
add_filter( 'frontpage_template_hierarchy', array( $this, 'use_page_template_hierarchy' ) );
7070
add_filter( 'post_thumbnail_html', '__return_empty_string' );
7171
}
7272

0 commit comments

Comments
 (0)