WordPress.org

Make WordPress Core

Ticket #14909: add-blog-name-to-press-this-title.php

File add-blog-name-to-press-this-title.php, 842 bytes (added by SergeyBiryukov, 7 years ago)
Line 
1<?php
2/*
3Plugin Name: Add Blog Name to Press This Title
4Version: 1.0
5Plugin URI: http://core.trac.wordpress.org/ticket/14909
6Description: Adds the blog name to Press This title on Writing Settings and Tools screens.
7Author: Sergey Biryukov
8Author URI: http://profiles.wordpress.org/sergeybiryukov/
9*/
10
11function 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}
24add_filter( 'gettext', 'change_press_this_title_14909', 10, 3 );
25?>