Skip to content

Instantly share code, notes, and snippets.

View kurtschlatzer's full-sized avatar

Kurt Schlatzer kurtschlatzer

View GitHub Profile
@kurtschlatzer
kurtschlatzer / patch-edid.md
Last active October 13, 2023 06:46 — forked from ejdyksen/patch-edid.md
Fix EDID problems on external monitors in Mac OS.
<?php
/**
* WordPress menu cache.
*
* @package BJ\Menu
* @author bjornjohansen
* @version 0.1.0
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2)
*/

Keybase proof

I hereby claim:

  • I am kurtschlatzer on github.
  • I am kurtschlatzer (https://keybase.io/kurtschlatzer) on keybase.
  • I have a public key whose fingerprint is 6126 1316 C9FE 560A 650B 8771 45D5 0AC9 D2CD 4E16

To claim this, I am signing this object:

@kurtschlatzer
kurtschlatzer / bootstrap-4-menu-wordpress-filters.md
Created August 8, 2019 14:06 — forked from jakebellacera/bootstrap-4-menu-wordpress-filters.md
Bootstrap 4 menus in WordPress via filters. No walker needed!

Bootstrap 4 menus in WordPress with filters

No walker needed!

This snippet allows you to create Bootstrap 4 menus without the use of a Walker. Instead, we're using filters to leverage WordPress core functionality as much as possible. Basically, all you need to do is this and you're done:

<nav class="navbar navbar-expand-lg fixed-top">
  <div class="container">
    <a class="navbar-brand" href="<?php echo home_url(); ?>">
@kurtschlatzer
kurtschlatzer / gist:6f58cb9c7099c93ffad6893d73af1fed
Created May 11, 2019 02:32 — forked from bryceadams/gist:050d886159265d6f5e6dbce649552704
Disable WooCommerce total spent / order count meta calculations
<?php
add_filter( 'get_user_metadata', 'mtkdocs_filter_user_metadata', 10, 4 );
function mtkdocs_filter_user_metadata( $value, $object_id, $meta_key, $single ) {
// Check if it's one of the keys we want to filter
if ( in_array( $meta_key, array( '_money_spent', '_order_count' ) ) ) {
// Return 0 so WC doesn't try calculate it
return 0;
}
// Default
@kurtschlatzer
kurtschlatzer / google-font-loader.js
Created April 23, 2014 16:16
Google Font Loader Example
// Google Fonts Loader Example
(function() {
// Configure font families
WebFontConfig = {
google: {
families: [
'Roboto:400,400italic,700,700italic,900,900italic:latin',
'Merriweather:400,400italic,700,700italic,900,900italic:latin'
@kurtschlatzer
kurtschlatzer / remove_wc_data.sql
Created January 3, 2019 20:20 — forked from growdev/remove_wc_data.sql
Remove WooCommerce orders, subscriptions, non admin users
# GET number of orders
select count(*)from wp_posts where post_type = 'shop_order';
# DELETE ORDERS
delete from wp_postmeta where post_id in (
select ID from wp_posts where post_type = 'shop_order');
delete from wp_posts where post_type = 'shop_order';
# DELETE order refunds
## Delete duplicate WooCommerce products
## (Retains the lowest ID)
## Pro tip: Change to SELECT to test
DELETE bad_rows.*
from wp_posts as bad_rows
inner join (
select post_title, MIN(id) as min_id
from wp_posts
where post_type = 'product'
@kurtschlatzer
kurtschlatzer / WP-missing-featured.sql
Created January 3, 2019 19:18 — forked from tomfordweb/WP-missing-featured.sql
Select All posts that are missing featured image
/**
* USE AT YOUR OWN RISK!
*
* In no way do I guarantee the accuracy of these queries to do exactly what you want on your own server.
* I have written them down for my own personal record, and you are free to use at your own discretion,
* and provide corrections.
*/
/**
* 1. Delete order and coupon meta data.