Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#18457 closed defect (bug) (fixed)

Parent Theme Editor styles should be included before Child Theme styles

Reported by: dd32's profile dd32 Owned by: dd32's profile dd32
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2
Component: Editor Keywords: dev-feedback has-patch
Focuses: Cc:

Description

Related: #14430 (and originally reported by somatic in #14430#comment:11 )

#14430 fixed the order of inclusion for css styles of the same name so that child theme styles could override the parents.

However, That only applied to stylesheers of the same name.

Consider:

child theme:
add_action( 'after_setup_theme', function() {
add_editor_style( 'child-style.css');
} );

parent theme:
add_action( 'after_setup_theme', function() {
add_editor_style( 'editor-style.css');
} );

Since they're not the same name, they'll be included in the order they were defined:

content_css:"
http://mysite.com/wp-content/themes/my-child-theme/child-style.css,
http://mysite.com/wp-content/themes/twentyeleven/editor-style.css"

Instead of looping over $editor_styles and adding the files as they're found, Perhaps the files should be sought after in the parent theme, and then a 2nd loop be run to find them all in the child themes folder.

Attachments (1)

18457.patch (701 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
12 years ago

  • Keywords has-patch added

#2 @dd32
12 years ago

  • Milestone changed from Awaiting Review to 3.3

#3 @dd32
12 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In [18572]:

Load all Parent theme stylesheets before Child theme stylesheets in the TinyMCE Editor. props SergeyBiryukov. Fixes #18457

Note: See TracTickets for help on using tickets.