Adding styles from plugins to the editor
-
When adding style files to the editor using add_editor_styles(), you can only specify relative paths for files in the theme folder.
Accordingly, when adding styles from the plugin (for example, fontello icons located in the plugin folder), you need to specify the URL instead of a local file path.
As a result:
– when generating the page, the file is loaded using wp_remote_get(), which is slower than using file_get_contents(). This slows down the loading of the editor with a large number of files.
– ‘baseURL’ attribute is not created for such files and CSS-styles with url() are processed incorrectly:
https://prnt.sc/yPljBoJ36raD
https://prnt.sc/vXEKdbcQHvOpIs it possible in the future to add support for styles from plugins using local paths and ensure correct handling of url() from styles, not in the theme folder?
- The topic ‘Adding styles from plugins to the editor’ is closed to new replies.