Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21026 closed defect (bug) (fixed)

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

Reported by: richardwo's profile richardwo Owned by: azaozz's profile azaozz
Milestone: 3.4.1 Priority: normal
Severity: normal Version: 3.4
Component: Editor Keywords: has-patch commit
Focuses: Cc:

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 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @georgestephanis
12 years ago

  • Cc George@… added

#2 @SergeyBiryukov
12 years ago

  • 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.

#3 @nacin
12 years ago

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

#4 @azaozz
12 years ago

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 12 years ago by azaozz (previous) (diff)

#5 @nacin
12 years ago

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.

#6 @nacin
12 years ago

  • Keywords commit added

#7 @nacin
12 years ago

  • 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.