Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extenders to remove additional format types. #204

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions classes/class-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ private function get_default_settings() {
'imgur',
],
],
'unregisterFormatType' => [
'core/text-color',
'core/image',
],
Comment on lines +334 to +337
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to better names for this option too, I just named it the same as the G function it was calling, there's probably a better naming format..

'editorType' => $this->get_editor_type(),
'allowUrlEmbed' => false,
'pastePlainText' => false,
Expand Down
5 changes: 2 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ domReady( () => {
// Modify any blocks we need to
addFilter( 'blocks.registerBlockType', 'blocks-everywhere/modify-blocks', customBlocks );

// Remove some formatting options
unregisterFormatType( 'core/text-color' );
unregisterFormatType( 'core/image' );
// Remove any formatting options we need to disable
wpBlocksEverywhere?.unregisterFormatType.forEach( ( formatType ) => unregisterFormatType( formatType ) );

if ( wpBlocksEverywhere.editorType === 'bbpress' && wpBlocksEverywhere.autocompleter ) {
addFilter(
Expand Down