WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#22644 closed defect (bug) (fixed)

wp_editor() on front end adds stylesheet to page

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

Description

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='http://mysite.com/themename/wp-includes/css/buttons.min.css?ver=3.5-RC2' type='text/css' media='all' />

Attachments (3)

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

Download all attachments as: .zip

Change History (11)

comment:1 nacin17 months 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?

helenyhou17 months ago

comment:2 helenyhou17 months 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.

koopersmith17 months ago

comment:3 koopersmith17 months ago

  • Keywords commit added

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

comment:4 koopersmith17 months ago

  • Keywords commit removed

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

koopersmith17 months ago

comment:5 koopersmith17 months ago

This should cover just about everything.

ack --php '<body'

comment:6 koopersmith17 months ago

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

comment:7 ocean9017 months ago

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

<?php wp_editor('Test content', 'frontend_editor'); ?>
<input type="button" class="button" value="Button" /><br/>
<a href="#" class="button">Link</a>
Last edited 17 months ago by ocean90 (previous) (diff)

comment:8 ryan17 months 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.