Support Forum
Hello,
I created a Gutenberg block and it renders fine but it's adding <p></p> like wpautop is running on the block template. I tried using the standard:
remove_filter('the_content','wpautop');
remove_filter('render_block','wpautop');
But nothing happens!
What am I doing wrong?
Here is my code to create the block:
// Video Background Section
$meta_boxes[] = array (
'title' => esc_html__( 'Video Background', 'text-domain' ),
'id' => self::PREFIX.'video-background',
'fields' => array(
array (
'id' => self::PREFIX . 'join_button_text',
'type' => 'text',
'name' => esc_html__( 'Join Button Text', 'text-domain' ),
'std' => 'Join Now',
),
array (
'id' => self::PREFIX . 'heading',
'type' => 'text',
'name' => esc_html__( 'Heading', 'text-domain' ),
'std' => 'Grow your piano studio',
),
array (
'id' => self::PREFIX . 'subheading',
'type' => 'textarea',
'name' => esc_html__( 'Sub Heading', 'text-domain' ),
'std' => 'Refresh your teaching, supercharge your business and feel supported every step of the way.',
),
array (
'id' => self::PREFIX . 'play_video_button_text',
'type' => 'text',
'name' => esc_html__( 'Play Video Button Text', 'text-domain' ),
'std' => 'Play Video',
),
),
'category' => self::CATEGORY,
'render_template' => lpg_get_plugin_path().'blocks/video-background.php',
//'enqueue_style' => lpg_get_plugin_path().'blocks/video-background.css',
'icon' => 'video-alt2',
'keywords' => array(
0 => 'video',
1 => 'background',
2 => 'top',
3 => 'header',
4 => 'hero',
5 => 'jumbotron',
),
'supports' => array(
'align' => ['wide', 'full'],
'customClassName' => true,
),
'description' => 'Video Background',
'type' => 'block',
'multiple' => false,
'enqueue_assets' => $this->load_gutenberg_styles('video-background'),
);
return $meta_boxes;