Skip to content

Commit

Permalink
Add doc for editor settings hooks (#1366)
Browse files Browse the repository at this point in the history
* Add docs for settings panel hooks

* Minor tweaks

* Fix ##

* Update settings-panel.md

* Update settings-panel.md

* Add @p-jackson to CONTRIBUTORS

Co-authored-by: Rich Tabor <hello@themebeans.com>
  • Loading branch information
p-jackson and Rich Tabor committed Feb 19, 2020
1 parent f3dfdca commit cc50dfa
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ This list is manually curated to include valuable contributions by volunteers th
| @broken8 | @adomenico |
| @andreilupu | @euthelup |
| @alexdenning | @alexdenning |
| @p-jackson | |
32 changes: 32 additions & 0 deletions docs/hooks/settings-panel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Editor Settings

## Customize labels

The following JavaScript filter will customize the text used for the menu item
label and panel titles:

```javascript
import { addFilter } from '@wordpress/hooks';

function updateSettingsTitle() {
return __( 'Here is a new title!', 'textdomain' );
}

addFilter(
'coblocks-settings-title',
'coblocks-settings-title',
updateSettingsTitle,
);
```

## Disable the modal entirely

The following `PHP` filter can be used to prevent the editor settings panel from appearing within the editor.

```php
add_filter( 'coblocks_show_settings_panel', '__return_false' );
```

## Screenshots
![editor-settings](https://user-images.githubusercontent.com/1813435/74862708-9c043d00-531a-11ea-9410-61968ad0e86d.jpg)
![editor-settings-open](https://user-images.githubusercontent.com/1813435/74862836-cfdf6280-531a-11ea-987c-2f795557b2d3.jpg)

0 comments on commit cc50dfa

Please sign in to comment.