Tribe__Events__Editor::deactivate_blocks_editor_event( bool $is_enabled, string $post_type )
Deactivate the blocks editor from the events post type unless explicitly enabled by the user via the settings on the events tab.
Contents
Parameters
- $is_enabled
-
(bool) (Required) If blocks editor is enabled or not.
- $post_type
-
(string) (Required) The current post type.
Return
(false)
Source
File: src/Tribe/Editor.php
public function deactivate_blocks_editor_event( $is_enabled, $post_type ) {
if ( Tribe__Events__Main::POSTTYPE !== $post_type ) {
return $is_enabled;
}
if ( tribe( 'events.editor.compatibility' )->is_blocks_editor_toggled_on() ) {
return $is_enabled;
}
return false;
}
Changelog
| Version | Description |
|---|---|
| 5.7.1 | Introduced. |