File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,22 @@ private function i18n() {
7272 * editor style
7373 */
7474 private function editor_style () {
75+ /**
76+ * Default file
77+ **/
7578 $ file = 'editor-style.css ' ;
7679
77- if ( ! defined ( 'SCRIPT_DEBUG ' ) || SCRIPT_DEBUG === false ) {
78- $ file = Framework::get_container ()->get_service ('assets ' )->get_min_file ( 'editor-style.css ' );
80+ if ( ! defined ( 'SCRIPT_DEBUG ' ) || false === SCRIPT_DEBUG ) {
81+ $ file = Framework::get_container ()->get_service ( 'assets ' )->get_min_file ( 'editor-style ' );
82+ }
83+
84+ /**
85+ * Do not enqueue a inexistant file on admin
86+ */
87+ if ( ! is_file ( get_theme_file_path ( 'dist/assets/ ' . $ file ) ) ) {
88+ return ;
7989 }
8090
81- add_editor_style ( 'dist/assets/ ' . $ file );
91+ add_editor_style ( 'dist/assets/ ' . $ file );
8292 }
8393}
You can’t perform that action at this time.
0 commit comments