-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc for editor settings hooks (#1366)
* 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
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |