1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Add Blog Name to Press This Title |
---|
4 | Version: 1.0 |
---|
5 | Plugin URI: http://core.trac.wordpress.org/ticket/14909 |
---|
6 | Description: Adds the blog name to Press This title on Writing Settings and Tools screens. |
---|
7 | Author: Sergey Biryukov |
---|
8 | Author URI: http://profiles.wordpress.org/sergeybiryukov/ |
---|
9 | */ |
---|
10 | |
---|
11 | function change_press_this_title_14909( $text, $original_text, $domain ) { |
---|
12 | if ( ! is_admin() || ! function_exists( 'get_current_screen' ) ) |
---|
13 | return $text; |
---|
14 | |
---|
15 | $current_screen = get_current_screen(); |
---|
16 | if ( ! $current_screen || ! in_array( $current_screen->id, array( 'options-writing', 'tools' ) ) ) |
---|
17 | return $text; |
---|
18 | |
---|
19 | if ( 'Press This' === $original_text && 'default' === $domain ) |
---|
20 | $text = get_bloginfo( 'name' ) . ' - ' . $text; |
---|
21 | |
---|
22 | return $text; |
---|
23 | } |
---|
24 | add_filter( 'gettext', 'change_press_this_title_14909', 10, 3 ); |
---|
25 | ?> |
---|