Skip to content

Instantly share code, notes, and snippets.

View oddevan's full-sized avatar

Evan Hildreth oddevan

View GitHub Profile
@oddevan
oddevan / challenge.md
Last active May 18, 2021 00:59 — forked from devinsays/challenge.md
WooCommerce MySQL Challenge

1. Get the order ids for all orders that have a shipping state of "New Jersey".

SELECT orders.ID
FROM `wp_posts` orders
  INNER JOIN `wp_postmeta` meta ON meta.post_id = orders.ID
WHERE
  orders.post_type = 'shop_order' AND
  meta.meta_key = '_shipping_state' AND
  meta.meta_value = 'NJ';
@oddevan
oddevan / fu-use-names-for-thumbnails.php
Last active January 3, 2016 08:39 — forked from bradt/wp-image-crop-position.php
Forked from wp-image-crop-position (see blog post here: http://bradt.ca/blog/image-crop-position-in-wordpress/) and modified according to this stack exchange question/answer: http://wordpress.stackexchange.com/questions/51920/set-custom-name-for-generated-thumbnails. Also packaged as a plugin.
<?php
/*
Plugin Name: Use Names for Thumbnail Images
Plugin URI: http://its.furman.edu/
Description: Generates resized images with names instead of dimensions (image-large.jpg instead of image-500x456.jpg).
Version: 1.0
Author: Evan Hildreth
Author URI: http://its.furman.edu/
*/