HHP Tools
Internal utilities for HHP web work (bookmarklets, snippets, quick links).
Bookmarklets
How to install (Chrome):
- Show Bookmarks Bar (Ctrl+Shift+B)
- Right-click → Add page…
- Name it
- Paste the bookmarklet code below into the URL field
- Click the bookmark while viewing a page on the site
Open Editor for Current Page (p01)
Opens the WordPress edit screen for the current front-end page in a new tab.
javascript:(()=>{const host="https://hhp.ufl.edu";const getId=()=>{try{const a=document.querySelector("#wp-admin-bar-edit a");if(a){const u=new URL(a.href);const p=u.searchParams.get("post");if(p)return p;}}catch(e){}const cls=(document.body&&document.body.className)||"";let m=cls.match(/\bpostid-(\d+)\b/);if(m)return m[1];m=cls.match(/\bpage-id-(\d+)\b/);if(m)return m[1];m=cls.match(/\bpost-(\d+)\b/);if(m)return m[1];return null;};let id=getId();if(!id){id=prompt("Couldn’t auto-detect ID. Paste Page/Post ID:");if(!id)return;}const url=host+"/wp-admin/post.php?post="+encodeURIComponent(id)+"&action=edit";window.open(url,"_blank","noopener,noreferrer");})();
Copy Editor URL for Current Page (p01)
Copies the WordPress edit URL to your clipboard.
javascript:(async()=>{const host="https://hhp.ufl.edu";const getId=()=>{try{const a=document.querySelector("#wp-admin-bar-edit a");if(a){const u=new URL(a.href);const p=u.searchParams.get("post");if(p)return p;}}catch(e){}const cls=(document.body&&document.body.className)||"";let m=cls.match(/\bpostid-(\d+)\b/);if(m)return m[1];m=cls.match(/\bpage-id-(\d+)\b/);if(m)return m[1];m=cls.match(/\bpost-(\d+)\b/);if(m)return m[1];return null;};let id=getId();if(!id){id=prompt("Couldn’t auto-detect ID. Paste Page/Post ID:");if(!id)return;}const edit=host+"/wp-admin/post.php?post="+encodeURIComponent(id)+"&action=edit";try{await navigator.clipboard.writeText(edit);alert("Copied edit URL:\n\n"+edit);}catch(e){prompt("Copy this URL:",edit);}})();