WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#14909 closed enhancement (maybelater)

Pass "_e('Press This')" through filter

Reported by: joehoyle Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Press This Keywords: has-patch
Focuses: Cc:

Description

Currently, there is no way for a plugin to change the "Press This" bookmarklet text in the Tools page. I recently had a client request to change the text, as they have an MS install - and want it to use "%blog name% - press this".

It would be good to pass that text through a filter 'press_this_bookmarklet' or something so plugins could alter it (as users drag it to their bookmarks, so the link's text is used).

I don't mind writing the patch if needed

For reference: http://core.trac.wordpress.org/browser/trunk/wp-admin/tools.php#L36

Attachments (2)

press_this.diff (2.2 KB) - added by joehoyle 9 years ago.
Added filter: press_this_title to Press This bookmarklet
add-blog-name-to-press-this-title.php (842 bytes) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (15)

#1 @nacin
9 years ago

_e() runs through the gettext filter. This seems like a good case where I would recommend not a separate filter, but the existing string filter, as this is a branding thing.

#2 @joehoyle
9 years ago

I did considered hooking into _e(), but I wouldn't be able to check what I was changing, or example, the header "Press This" on the tools page as does "_e( 'Press This' )", doing a replace on that would do it site wide, which may have unwanted effects.

I don't really see this as branding - the point is to make the Press This bookmarklet more usable, having a bunch of "Press This" titles bookmarlkets on your bookmarks toolbar for 5 different WP sites IMO is not very usable.

The Press This bookmarklet is a special feature, it's not just some arbitrary text - it's a specific button tool made for drag n drop.

#3 @dd32
9 years ago

I don't see the harm in a filter on the title, Whilst its simple to rename the bookmarklet once added, being able to brand it in a Network setup would be advantageous to some.

Potential thought for a filtername: 'press_this_title'?

#4 @dd32
9 years ago

  • Component changed from General to Press This

#5 follow-up: @nacin
9 years ago

Agreed, the use case makes complete sense. I'd almost want to drop in a bloginfo('name') in core...

Heads up for patch/commit -- Press This is in two spots, see also options-writing.php I think.

#6 @dd32
9 years ago

I'd almost want to drop in a bloginfo('name') in core...

Me too, But it makes the title too long for little gained benefit to me unfortunately.

@joehoyle
9 years ago

Added filter: press_this_title to Press This bookmarklet

#7 @joehoyle
9 years ago

  • Keywords has-patch needs-review added

#8 @westi
9 years ago

  • Milestone changed from Awaiting Review to Future Release

A filter here doesn't make much sense to me.

I can see for multisite that we could add the name otherwise you can use the existing gettext filter

#9 follow-up: @joehoyle
8 years ago

I can see for multisite that we could add the name otherwise you can use the existing gettext filter

But you can't use the gettext filter, because "Press This" text may be used elsewhere (titles etc) which would not want to be affected. I am not sure why a filter does not make sense, letting plugin devs change the Press This bookmarklet doesn't seem too wild?

#10 in reply to: ↑ 5 @Viper007Bond
8 years ago

Replying to nacin:

Agreed, the use case makes complete sense. I'd almost want to drop in a bloginfo('name') in core...

I think this is worth doing, even for non-MS sites. Many people manage multiple WP blogs and this would make it easier to figure out where they are pressing. I know it'll be long, but worth it. (Or maybe we enforce a max-length?)

There should be a filter regardless, but I think we can do a better job with the default text.

#11 @joehoyle
7 years ago

Is there a consensus on this?

Option 1: Change to show multisite name is is_multisite()
Option 2: Change to include site name, but also pass through filter

Of course, close if non

#12 @joehoyle
6 years ago

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

Closing as i appears there is little interest in this

#13 in reply to: ↑ 9 @SergeyBiryukov
6 years ago

  • Keywords needs-review removed
  • Milestone Future Release deleted
  • Type changed from defect (bug) to enhancement

Replying to joehoyle:

But you can't use the gettext filter, because "Press This" text may be used elsewhere (titles etc) which would not want to be affected.

You can use get_current_screen() to change the title only on selected screens.

I've attached a workaround plugin: add-blog-name-to-press-this-title.php.

Note: See TracTickets for help on using tickets.