Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_shortcut_link [ WordPress Function ]

get_shortcut_link ( No parameters )
Returns:
  • (string)
Defined at:



Retrieve the Press This bookmarklet link.

Use this in 'a' element 'href' attribute.

Source


<?php
function get_shortcut_link() {
    
// In case of breaking changes, version this. #WP20071
    
$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='" 
admin_url('press-this.php') . "',
            l=d.location,
            e=encodeURIComponent,
            u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';
            a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;};
            if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
            void(0)"
;

    
$link str_replace(array("\r""\n""\t"),  ''$link);

    return 
apply_filters('shortcut_link'$link);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics