WordPress / better-code-editing

[✅ Merged into 4.9-alpha] Better Code Editing WordPress plugin
https://wordpress.org/plugins/better-code-editing/
37 stars 16 forks source link

Revisit CodeMirror filters #35

Closed westonruter closed 7 years ago

westonruter commented 7 years ago

There are currently filters for theme_editor_codemirror_opts, plugin_editor_codemirror_opts, and customizer_custom_css_codemirror_opts. By returning a falsey value from any of these filters, it will cause CodeMirror to not be displayed on the related screen. There is no such filter for the Custom HTML widget. Moreover, the short-circuit via these filters is not the same as short-circuiting via the user profile screen. The two should be unified so that the no CodeMirror assets are enqueued if it will be disabled anyway. Do we need a separate filter for each context? Or should one filter be used for each, but an additional context param provided to distinguish where the editor is going to be rendered?

westonruter commented 7 years ago

Fixed by #38 where there is now a single wp_code_editor_settings filter.