Skip to content

Commit a9db0b3

Browse files
committed
Disable Gutenberg editor
1 parent a1773e2 commit a9db0b3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

classes/class-cpt-wplf-form.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct() {
3838

3939
add_filter( 'default_content', array( $this, 'default_content_cpt' ) );
4040
add_filter( 'user_can_richedit', array( $this, 'disable_tinymce' ) );
41+
add_filter( 'use_block_editor_for_post_type', array( $this, 'disable_gutenberg'), 10, 2 );
4142

4243
// front end
4344
add_shortcode( 'libre-form', array( $this, 'shortcode' ) );
@@ -135,6 +136,17 @@ public function disable_tinymce( $default ) {
135136
return $default;
136137
}
137138

139+
/**
140+
* Disable Gutenberg editor
141+
*/
142+
public function disable_gutenberg( $is_enabled, $post_type ) {
143+
if( $post_type === 'wplf-form') {
144+
return false;
145+
}
146+
147+
return $is_enabled;
148+
}
149+
138150
/**
139151
* Berore permanently deleting form entry, remove attachments
140152
* in the case they were not added to media library

0 commit comments

Comments
 (0)