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

Possibility to filter the editor settings #7400 #7404

Closed
wants to merge 1 commit into from

Conversation

dannydehaan
Copy link

@dannydehaan dannydehaan commented Jun 20, 2018

Description

For local development, you don't want Gutenberg to save a post every 10 seconds. So I've wrapped an apply_filters around $editor_settings in /lib/client-assets.php. See: #7400

How has this been tested?

Checked in local environment with:

add_filter( 'editor_settings', function( $editor_settings ) {
    $editor_settings['autosaveInterval'] = 3600;
} );

In the file /lib/client-assets.php, I var_dumped the $editor_settings to see if the outcome was 3600.

Types of changes

It adds a filter around the $editor_settings var in /lib/client-assets.php

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@Soean Soean added [Type] Enhancement A suggestion for improvement. [Feature] Extensibility The ability to extend blocks or the editing experience labels Jun 20, 2018
@danielbachhuber
Copy link
Member

Per #7400 (comment), I'm not quite sure it makes sense to make the entirety of $editor_settings filterable. This seems like a large hammer for a smaller, nuanced issue.

@youknowriad
Copy link
Contributor

It's already possible to update the editor settings by doing:

wp.data.dispatch('core/editor').updateEditorSettings( editorSettingsObject )

@gziolo
Copy link
Member

gziolo commented Jul 10, 2018

Closing as per comment from @youknowriad.

@gziolo gziolo closed this Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants