Skip to content
This repository has been archived by the owner. It is now read-only.

Combine wp_code_editor_settings() into wp_enqueue_code_editor() #55

Closed
westonruter opened this issue Aug 28, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@westonruter
Copy link
Member

commented Aug 28, 2017

For the post editor, there is just wp_enqueue_editor(). The code editor currently has a wp_enqueue_code_editor() function that takes a $settings arg which has the configuration for the desired editor, which is then used to determine which scripts and styles get enqueued. The $settings array is generated by wp_code_editor_settings(). However, having two separate functions may not make sense, and perhaps the arg passed into wp_code_editor_settings() should just be what is passed into wp_enqueue_code_editor().

Additionally, the $context arg that is passed into wp_code_editor_settings() should maybe be cleaned up. If $context['file'] is always required, then maybe it should take a $file arg followed by a $context. Or maybe file shouldn't be required all, and it could accept a type instead, which would make some more sense in the case of Additional CSS and the Custom HTML widget.

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2017

The addition of a type context param was added in #66.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.