#21026 closed defect (bug) (fixed)

add_editor_style() in child theme not working for editor_style.css

Reported by: richardwo Owned by: azaozz
Priority: normal Milestone: 3.4.1
Component: Editor Version: 3.4
Severity: normal Keywords: has-patch commit
Cc: George@…

Description

created a child theme of twentyeleven
functions.php contains add_editor_style();
editor-style.css in the theme folder.
This file is not picked up by TinyMCE (confirmed by looking at tinyMCEPreInit in source).

Changing the name of the css file to e.g. child-editor-style.css and using add_editor_style( 'child-editor-style.css' );
works fine.

Attachments (1)

21026.patch (575 bytes) - added by SergeyBiryukov 11 months ago.

Download all attachments as: .zip

Change History (8)

  • Cc George@… added
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4.1

In [20059], the line was introduced to prevent a stylesheet from loading by a parent theme if a file with the same name was already loaded by a child theme:

$editor_styles[$key] = '';

In [20342], this behaviour was reversed (comment:ticket:19437:14).

Not sure if the line was necessary in the first place. Moving to 3.4.1, as it's technically a regression.

  • Owner set to azaozz
  • Status changed from new to assigned

The patch works as expected. For child themes it will be testing up to four locations for each file added to the $editor_styles global, two for .css and two for -rtl.css.

Last edited 11 months ago by azaozz (previous) (diff)

In [21114]:

Allow add_editor_style() to load a child theme's editor style when the parent theme's style exists for the same filename. props SergeyBiryukov. see #21026 for trunk.

  • Keywords commit added
  • Resolution set to fixed
  • Status changed from assigned to closed

In [21123]:

Allow add_editor_style() to load a child theme's editor style when the parent theme's style exists for the same filename. props SergeyBiryukov. fixes #21026 for 3.4.

Note: See TracTickets for help on using tickets.