Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22644 closed defect (bug) (fixed)

wp_editor() on front end adds stylesheet to page

Reported by: itworx's profile itworx Owned by: helenyhou's profile helenyhou
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Editor Keywords: has-patch
Focuses: Cc:


Seems wp_editor is adding a stylesheet to posts when inserted on front end. These styles override theme styles for .button ++

<link rel='stylesheet' id='buttons-css' href='' type='text/css' media='all' />

Attachments (3)

22644.diff (8.6 KB) - added by helenyhou 12 years ago.
22644.2.diff (9.1 KB) - added by koopersmith 12 years ago.
22644.3.diff (22.8 KB) - added by koopersmith 12 years ago.

Download all attachments as: .zip

Change History (11)

#1 @nacin
12 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Owner set to helenyhou
  • Status changed from new to assigned

We knew this bug report would come eventually.

The plan of attack that comes to mind for me:

  • Keep buttons.css in the admin only.
  • Have our own button classes and styles for the media modal that can work on the frontend. Probably .wp-button or even .wp-media-button.

I know koopersmith and helenyhou have spoken — what's the verdict?

12 years ago

#2 @helenyhou
12 years ago

  • Keywords has-patch added

Something else, as presented in IRC :) A container/scoping class, let's say .wp-core-ui. So, body.wp-core-ui for the admin, .wp-core-ui on wrappers for things that can be used outside the admin itself but use styling provided by core (WP_Editor, media).

Koop is doing an extra check for any other places where we may need the class, and any other realizations are more than welcome. 22644.diff as a start, though.

12 years ago

#3 @koopersmith
12 years ago

  • Keywords commit added

Added a bit to make sure .wp-core-ui is always set in new media. Ready to go.

#4 @koopersmith
12 years ago

  • Keywords commit removed

We need more! setup-config, install, upgrade, media-upload, and customize all need love.

12 years ago

#5 @koopersmith
12 years ago

This should cover just about everything.

ack --php '<body'

#6 @koopersmith
12 years ago

Also updates the .welcome-button to use the .button-hero size instead.

#7 @ocean90
12 years ago

Couldn't see any issues with 22644.3.diff. Tested also on a page template for Twenty Eleven with:

<?php wp_editor('Test content', 'frontend_editor'); ?>
<input type="button" class="button" value="Button" /><br/>
<a href="#" class="button">Link</a>
Version 0, edited 12 years ago by ocean90 (next)

#8 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 22948:

Scope button classes so they can be used on the frontend without interfering with theme styles.

Props helenyhou, koopersmith
fixes #22644

Note: See TracTickets for help on using tickets.