Skip to content

Instantly share code, notes, and snippets.

View asolopovas's full-sized avatar

Andrius Solopovas asolopovas

View GitHub Profile
#!/bin/bash
# Script to remove specified taxonomy terms from posts of a certain type tagged with a specific term
# Define variables
POST_TYPE="custom_post_type" # Example: "floors"
PRIMARY_TAXONOMY="primary_taxonomy" # Example: "fltypes"
SPECIFIC_TERM="specific_term" # Example: "discontinued"
SECONDARY_TAXONOMY="secondary_taxonomy" # Example: "fltones"
@asolopovas
asolopovas / mutateCache.js
Last active May 22, 2021 12:09
Mutate vue apollo cache
export function mutateCache(q, cb) {
let query = q.hasOwnProperty('variables')
? {query: q.query, variables: q.variables}
: {query: q}
let data = cache.readQuery(query)
cb(data)
cache.writeQuery({
...query,