WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#21026 closed defect (bug) (fixed)

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

Reported by: richardwo Owned by: 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 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 @georgestephanis3 years ago

  • Cc George@… added

@SergeyBiryukov3 years ago

comment:2 @SergeyBiryukov3 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.

comment:3 @nacin3 years ago

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

comment:4 @azaozz3 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 3 years ago by azaozz (previous) (diff)

comment:5 @nacin3 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.

comment:6 @nacin3 years ago

  • Keywords commit added

comment:7 @nacin3 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.