Make WordPress Core

Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#16935 closed enhancement (fixed)

Add filter to selected text in press-this.php

Reported by: topdownjimmy's profile topdownjimmy Owned by:
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.1
Component: Press This Keywords: has-patch
Focuses: Cc:

Description

When using the "Press This" bookmarklet, any text selected on the current page is inserted into the post body textarea. This should be wrapped in a <blockquote> tag with some appropriate class name.

Attachments (4)

press_this_blockquote.diff (774 bytes) - added by ldebrouwer 14 years ago.
Added blockquotes to the "Press This" content.
press_this_blockquote_2.diff (808 bytes) - added by topdownjimmy 14 years ago.
Added blockquote with "press-this-selection" class
press_this_blockquote_3.diff (832 bytes) - added by topdownjimmy 14 years ago.
Previous patch fixed to include single quotes instead of double quotes on class name
16935.2.patch (504 bytes) - added by c3mdigital 12 years ago.
Filter for selected text

Download all attachments as: .zip

Change History (22)

@ldebrouwer
14 years ago

Added blockquotes to the "Press This" content.

#1 @ldebrouwer
14 years ago

  • Cc info@… added
  • Keywords has-patch needs-testing dev-feedback 2nd-opinion added

I didn't add a class, I did add the cite attribute. However this still needs an okay from higher up for the feature request to be honored. I can see the 'need' for this because why would anybody want to copy content from a different website without a <blockquote>, unless they're stealing content ;)

#2 @topdownjimmy
14 years ago

Would "press-this-selection" be an appropriate class name?

@topdownjimmy
14 years ago

Added blockquote with "press-this-selection" class

#3 @topdownjimmy
14 years ago

Just added another patch including your changes plus the class "press-this-selection"

This is my first time contributing a patch so I hope I've done it correctly.

#4 @topdownjimmy
14 years ago

Ha, already screwed that up. I used double quotes where I should have used single quotes. New patch corrected and uploaded. Apologies.

@topdownjimmy
14 years ago

Previous patch fixed to include single quotes instead of double quotes on class name

#5 @ocean90
14 years ago

  • Component changed from General to Press This
  • Keywords dev-feedback removed

Related: #16935

#6 @jane
13 years ago

For the record, I would love selected area to automatically get blockquoted.

#7 @c3mdigital
12 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

I would rather see a filter for $selection than forcing it in blockquotes. Many different uses out there for press-this. Let the theme or end user decide how front end content gets marked up. I'm closing as wont fix please reopen if you have any further thoughts.

#8 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted

#9 @SergeyBiryukov
12 years ago

Feel free to reopen with a patch adding a filter for $selection.

#10 follow-up: @topdownjimmy
12 years ago

Any styling hook would be beneficial, I think -- just *something* to allow Press This to be more effortless.

I'm not sure what you mean by adding a filter for $selection, however.

#11 in reply to: ↑ 10 @c3mdigital
12 years ago

Replying to topdownjimmy:

Any styling hook would be beneficial, I think -- just *something* to allow Press This to be more effortless.

I'm not sure what you mean by adding a filter for $selection, however.

$selection is the variable that holds the selected text that gets added to the editor. Adding a filter (see: patch) will allow you to wrap any html you wanted around it.

Last edited 12 years ago by c3mdigital (previous) (diff)

@c3mdigital
12 years ago

Filter for selected text

#12 @c3mdigital
12 years ago

  • Keywords 2nd-opinion needs-testing removed
  • Resolution wontfix deleted
  • Status changed from closed to reopened

#13 @c3mdigital
12 years ago

  • Summary changed from Wrap selected text in <blockquote> in press-this.php to Add filter to selected text in press-this.php

#14 @SergeyBiryukov
12 years ago

  • Milestone set to 3.7
  • Type changed from feature request to enhancement

#15 @helen
12 years ago

  • Milestone changed from 3.7 to Future Release

I don't know how useful this filter really is as it stands - you're going to be string replacing or regex-ing HTML and praying no other filters are there. It should pass the original $selection for context, probably, so one could just wrap that with whatever.

#16 @kraftbj
10 years ago

  • Resolution set to worksforme
  • Status changed from reopened to closed

#17 @DrewAPicture
10 years ago

  • Milestone Future Release deleted

#18 @SergeyBiryukov
10 years ago

  • Milestone set to 4.2
  • Resolution changed from worksforme to fixed
Note: See TracTickets for help on using tickets.