Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created July 16, 2024 15:30
Show Gist options
  • Save jpluimers/e62d0d7018774ed070dc6ce2110aeb40 to your computer and use it in GitHub Desktop.
Save jpluimers/e62d0d7018774ed070dc6ce2110aeb40 to your computer and use it in GitHub Desktop.
Edit current current blog post in WordPress Classic Editor
javascript:(function(){ var postID = document.getElementsByName("comment_post_ID")[0]?.value; var a = document.createElement("a"); if ((typeof HighlanderComments === 'undefined') || (HighlanderComments == null)) { a.href = document.querySelector('link[rel="EditURI"]').href; var searchParams = new URLSearchParams(window.location.search); } else { a.href=HighlanderComments.connectURL; }; a.pathname='wp-admin/post.php'; a.search=`post=${postID}&action=edit&classic-editor`; a.hash=''; open(a.href); } )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment