Skip to content

Instantly share code, notes, and snippets.

View kmwalsh's full-sized avatar
🤖

Kate Walsh kmwalsh

🤖
View GitHub Profile
<?php
/**
* Check ACF Field Use
*
* Plugin Name: Check ACF Field Use
* Plugin URI: https://wordpress.org/plugins/check-acf-field-use/
* Description: Check how many times an ACF field is used across your site, get useful data, post links, etc.
* Version: 1.0.0
* Author: KMW
@kmwalsh
kmwalsh / gist:89562fd8468fd91c68d84d10f17988cb
Created September 13, 2024 18:10
mysql query to get post ID, title, etc. from wp postmeta where you have flexible content with a numeric ID value
/**
* - Flexible Content created with ACF
* - Field that lets you select a Gravity Form, loads the GF ID for use in templates (can replace this with whatever, as long as the meta value assignment is to an ID)
* - Query lets you get a list of all posts using the flex content to display the form
*/
SELECT DISTINCT ID, post_title, post_status, guid, meta_value from `wp_posts`
LEFT JOIN `wp_postmeta` ON `post_id` = `ID`
WHERE `post_status` = 'publish' AND `meta_key` LIKE '%gravity_form%' AND `meta_value` REGEXP '^[0-9]+$';
/**
* SearchWP relevant customization.
*
* @package lnct
*/
class LNCT_SearchWP {
public function __construct() {
add_filter( 'searchwp_live_search_query_args', [ $this, 'restrict_searchwp_post_types'] );
@kmwalsh
kmwalsh / gist:2f2f3e0d46681bae34aedc31e65a0115
Created March 8, 2024 19:44
Fix inaccurate comment counts across a WP multisite via wp cli
/**
* Fix inaccurate comment counts across a WP multisite
*
*/
class Multisite_Comments_Fix {
/**
* Class construction.
*/
@kmwalsh
kmwalsh / slack-analgesic.css
Last active February 26, 2024 17:44
Make Slack less painful.
/* ==UserStyle==
@name slack.com - 6/6/2023, 6:08:37 PM
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A Slack in-browser customization style
@author github.com/kmwalsh
==/UserStyle== */
@-moz-document domain("app.slack.com") {
* {
@kmwalsh
kmwalsh / automatically prepend ticket number to commit message
Last active December 11, 2023 17:40
automatically prepend ticket number to commit message
* mv .git/hooks/commit-msg.sample .git/hooks/commit-msg
* chmod ug+x .git/hooks/commit-msg
paste the desired script into commit-msg
Use this template when reporting a security vulnerability in Slack.
It can be inefficient to have to dig through a thread to figure out
what to do next. Presenting all of the information in the initial
disclosure message is ideal. Additionally, it is harrowing to
receive notification of a security vulnerability and can cause much
strife and chaos and confusion. This prevents some emotional chaos.
---
**Plugin:** (link to plugin repo)
@kmwalsh
kmwalsh / gist:863415ac6b9efa8f9e69ff2557c7cbbf
Last active June 29, 2023 18:21
Official guide to seriously official development slang
yeet = deploy. Use example: let’s yeet this to production.
yolo = do it on live. Use example: I’ma yolo that change – no staging.
yoinked/yoinkerized = pulled repo. Use example: I'ma yoinkerize the latest changes from main.
glow up = redesign. Use example: Their site is from 2010, needs a total glow up.
snack = clever piece of code. Use example: That function you wrote is a lil snack.
alias install-wp="curl -0 https://wordpress.org/latest.zip > latest.zip && unzip latest.zip && mv wordpress/* ./ && rm latest.zip && rm -r wordpress"
https://drewdevault.com/2018/07/02/Email-driven-git.html
Date: Mon, 11 Jun 2018 14:19:22 -0400
From: Drew DeVault <sir@cmpwn.com>
To: Gregory Mullen <omitted>
Subject: Re: [PATCH 2/3 todo] Filter private events from events feed
On 2018-06-11 9:14 AM, Gregory Mullen wrote:
> diff --git a/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py b/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py
> -%<-