Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#31493 closed defect (bug) (fixed)

Press This: Remove classes from suggested blockquote and source

Reported by: michael-arestad Owned by: azaozz
Priority: normal Milestone: 4.2
Component: Press This Version: 4.2
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

While I can see these classes being handy, we probably shouldn't keep them around.

Attachments (5)

31493.patch (959 bytes ) - added by michael-arestad 12 years ago.
31493.2.patch (1.2 KB ) - added by kraftbj 12 years ago.
Refresh of patch after [31595]
31493.3.patch (3.2 KB ) - added by kraftbj 12 years ago.
31493.4.patch (2.8 KB ) - added by kraftbj 12 years ago.
Same as .3 except default to em instead of cite and removes unintentional inclusion of testing code from hello.php
31493.5.patch (2.7 KB ) - added by azaozz 12 years ago.

Download all attachments as: .zip

Change History (13)

#1 @michael-arestad
12 years ago

  • Keywords has-patch added

#2 @ocean90
12 years ago

A class for the source paragraph was requested in #16922.

#3 @michael-arestad
12 years ago

I'm aware. I don't see a huge reason for Press This to add extra classes the full editor doesn't add. I don't think the majority would use it.

I'm also still on the fence for the cite tag since you can't remove it without hopping into the text editor and the cite tag's default styles tend to appear to be italic. Seems confusing.

#4 @kraftbj
12 years ago

Personally, I like the cite tag since it has a semantic purpose. The particular classes, hearing feedback that it's a lot of cruft on the front end, can be dropped.

A middle ground: a filter, etc that would allow classes to be set if desired by a third-party plugin (noting that I haven't checked the current status of the code and what filters have already been added).

#5 @danielbachhuber
12 years ago

Could we have a filter for the entirety of the default text? Something like:

$default_text = apply_filters( 'press_this_default_text', $default_text, $all_variables );

I'd like to be able to keep my current format.

A stretch goal would be a filter for the sniffing action too — Fusion would like to reuse Press This for our quote, link, and note custom post types.

@kraftbj
12 years ago

Refresh of patch after [31595]

@kraftbj
12 years ago

#6 @kraftbj
12 years ago

31493.3 acknowledges @danielbachhuber point of a "legacy" mode:

* Renames `press_this_suggested_html` filter to `press_this_suggested_source_html`.
* Adds `press_this_suggested_default_html` filter to modify the wrapper/html associated with the blockquote.
* Continues the original patch of removing the default classes on both items.

"Legacy" mode could be done via a couple of filters, e.g.

add_filter( 'press_this_suggested_default_html', 'bk_pt_legacy_default' );
function bk_pt_legacy_default() {
$default_html = '';
return $default_html;
}

add_filter( 'press_this_suggested_source_html', 'bk_pt_legacy_source' );
function bk_pt_legacy_source() {
$source_html = '<a href="%1$s">%2$s</a>';
return $source_html;
}

@kraftbj
12 years ago

Same as .3 except default to em instead of cite and removes unintentional inclusion of testing code from hello.php

@azaozz
12 years ago

#7 @azaozz
12 years ago

  • Milestone Awaiting Review4.2

In 31493.5.patch: use one filter for the suggested html in the editor, and an associative array as param.

#8 @azaozz
12 years ago

  • Owner set to azaozz
  • Resolutionfixed
  • Status newclosed

In 31601:

Press This:

  • Remove classes from suggested HTML for the editor.
  • Improve the filter, pass an associative array as param.
  • Use <em> instead of <cite>.

Props Michael-Arestad, kraftbj. Fixes #31493.

Note: See TracTickets for help on using tickets.