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

Update filter in Widget Block Editor docs #32759

Merged
merged 1 commit into from
Jun 22, 2021
Merged
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
8 changes: 4 additions & 4 deletions docs/how-to-guides/widgets/opting-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For example, a theme may have the following PHP code in `functions.php`.
function example_theme_support() {
remove_theme_support( 'widgets-block-editor' );
}
add_action( 'after_setup_theme', example_theme_support' );
add_action( 'after_setup_theme', 'example_theme_support' );
```

## Using the Classic Widgets plugin
Expand All @@ -23,12 +23,12 @@ With this plugin installed, the Widgets Block Editor can be toggled on and off b

## Using a filter

the `gutenberg_use_widgets_block_editor` filter controls whether or not the Widgets Block Editor is enabled.
the `use_widgets_block_editor` filter controls whether or not the Widgets Block Editor is enabled.

For example, a site administrator may include the following PHP code in a mu-plugin to disable the Widgets Block Editor.

```php
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
add_filter( 'use_widgets_block_editor', '__return_false' );
```

For more advanced uses, you may supply your own function. In this example, the Widgets Block Editor is disabled for a specific user.
Expand All @@ -40,5 +40,5 @@ function example_use_widgets_block_editor( $use_widgets_block_editor ) {
}
return $use_widgets_block_editor;
}
add_filter( 'gutenberg_use_widgets_block_editor', 'example_use_widgets_block_editor' );
add_filter( 'use_widgets_block_editor', 'example_use_widgets_block_editor' );
```