diff --git a/src/wp-admin/includes/class-wp-press-this.php b/src/wp-admin/includes/class-wp-press-this.php index bc6f7f90ff..3ff242bed8 100644 --- a/src/wp-admin/includes/class-wp-press-this.php +++ b/src/wp-admin/includes/class-wp-press-this.php @@ -13,8 +13,8 @@ * @since 4.2.0 */ class WP_Press_This { - // Used to trigger the bookmarklet update notice. + const VERSION = 8; public $version = 8; private $images = array(); diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 4d2a757d26..0460a3284d 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -2898,15 +2898,10 @@ function the_comments_pagination( $args = array() ) { * @since 2.6.0 * * @global bool $is_IE Whether the browser matches an Internet Explorer user agent. - * @global WP_Press_This $wp_press_this - * - * @return string The Press This bookmarklet link URL. */ function get_shortcut_link() { global $is_IE; - $GLOBALS['wp_press_this'] = new WP_Press_This(); - $bookmarklet_version = $GLOBALS['wp_press_this']->version; $link = ''; if ( $is_IE ) { @@ -2924,7 +2919,7 @@ function get_shortcut_link() { $link = 'javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,' . 's=(e?e():(k)?k():(x?x.createRange().text:0)),f=' . $url . ',l=d.location,e=encodeURIComponent,' . - 'u=f+"?u="+e(l.href)+"&t="+e(d.title)+"&s="+e(s)+"&v=' . $bookmarklet_version . '";' . + 'u=f+"?u="+e(l.href)+"&t="+e(d.title)+"&s="+e(s)+"&v=' . WP_Press_This::VERSION . '";' . 'a=function(){if(!w.open(u,"t","toolbar=0,resizable=1,scrollbars=1,status=1,width=600,height=700"))l.href=u;};' . 'if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();void(0)'; } @@ -2934,7 +2929,7 @@ function get_shortcut_link() { $src = @file_get_contents( ABSPATH . 'wp-admin/js/bookmarklet.min.js' ); if ( $src ) { - $url = wp_json_encode( admin_url( 'press-this.php' ) . '?v=' . $bookmarklet_version ); + $url = wp_json_encode( admin_url( 'press-this.php' ) . '?v=' . WP_Press_This::VERSION ); $link = 'javascript:' . str_replace( 'window.pt_url', $url, $src ); } }