Skip to content

Instantly share code, notes, and snippets.

View chris-castillo-dev's full-sized avatar

Chris Castillo chris-castillo-dev

View GitHub Profile
javascript:!function(){for(var e=document.querySelectorAll("#services-section .category-services-container"),t=[],r=0;r<e.length;r++){var a=e[r],o=[],n=[],l=a.querySelector(":first-child span");if(l){var c=l.textContent;o.push(c.substring(0,c.length-1))}var i=a.querySelector(".view-button");i&&i.click();for(var v=a.querySelectorAll(".btn-related-category"),s=0;s<v.length;s++){var h=v[s];n.push(h.textContent)}for(var u=0;u<n.length;u++)t.push([o[0],n[u]])}for(var d="Container Label,Category\n",y=0;y<t.length;y++){var g=t[y];d+=g[0]+","+g[1]+"\n"}var p=document.createElement("textarea");p.value=d,document.body.appendChild(p),p.select(),document.execCommand("copy"),document.body.removeChild(p),alert("Data copied to clipboard")}();
javascript:!function e(){let t=document.querySelector("main ol");if(t)!function e(t){let o=Array.from(t.querySelectorAll("li")).map(e=>{let t=e.querySelector("span:nth-child(2)").textContent.trim(),o=e.querySelector("span:nth-child(3)").textContent.trim();return{Keyword:t,"Search Volume":o}}),r=o.map(e=>Object.values(e).join(";")).join("\n");navigator.clipboard.writeText("Keyword;Search Volume\n"+r).then(()=>{alert("Keyword and Search Volume data copied to clipboard with headers")}).catch(e=>{alert("Failed to copy data to clipboard:\n"+e)})}(t);else{let o=document.querySelector('iframe[src*="/local/business/"]');if(o){let r=o.getAttribute("src");window.open(r,"_blank")}else alert("Ordered list not found inside main tag and no matching iframe found.")}}();
javascript:(function(){
const folderID = "GOOGLE_DRIVE_FOLDER_ID";
var userInput = prompt("What would you like to search for?");
if(userInput){
userInput = encodeURIComponent(userInput);
var url = "https://drive.google.com/drive/u/0/search?q=" + userInput + "%20in:" + folderID;
window.location.href = url;
}
})();
// Get the <body> element
const bodyElement = document.querySelector('body');
// Extract all classes on the <body> element
const bodyClasses = Array.from(bodyElement.classList);
// Join the classes into a comma separated string
const bodyClassesString = bodyClasses.join(',');
return bodyClassesString;
/**
* Add Page Attrribute Terms (Taxonomy) to Body Tag
*/
function pro_page_attributes_class_to_body( $classes ){
if ( $pageTaxonomy = get_the_terms( get_the_ID(), 'page_attributes' ) ) {
foreach( $taxonomyTerm as $term ){
if(is_array($term)){
if(!empty($term['slug'])){
$termClass = 'page-attribute-' . $term['slug'];
array_push( $classes, $termClass );
function add_page_attributes_taxonomy() {
$args = array(
'label' => __( 'Page Attributes', 'textdomain' ),
'public' => false,
'rewrite' => false,
'hierarchical' => false,
'show_ui' => true,
'show_in_quick_edit' => true, // Added this line to show in Quick Edit
'show_admin_column' => true,
);
/**
* Add Page Terms (Taxonomy) to Body Tag
*/
function pro_page_taxonomy_class_to_body( $classes ){
if ( $pageTaxonomy = get_the_terms( get_the_ID(), 'my_taxonomy_slug' ) ) {
foreach( $taxonomyTerm as $term ){
if(is_array($term)){
if(!empty($term['slug'])){
$termClass = 'mytaxonomy-' . $term['slug'];
array_push( $classes, $termClass );