Skip to content

Instantly share code, notes, and snippets.

View briantw's full-sized avatar

Brian Tristam Williams briantw

View GitHub Profile
@briantw
briantw / Bookmarklet Functionality for WordPress
Created April 21, 2020 11:04
Since WordPress removed the original bookmarklet functionality, I needed to make a plan to restore the functionality in my Chrome browser. Create a new bookmark, right-click, Edit..., paste the code in the URL field. Just replace yoursite.com with your Wordpress URL
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 = 'https://yoursite.com/wp-admin/press-this.php',
l = d.location,
e = encodeURIComponent,
g = f + '?u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s) + '&url-scan-submit=Scan';