Skip to content

Instantly share code, notes, and snippets.

Gabe Shackle hereswhatidid

Block or report user

Report or block hereswhatidid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hereswhatidid
hereswhatidid / gw-require-list-columns.php
Created May 3, 2018 — forked from spivurno/gw-require-list-columns.php
Gravity Wiz // Require All Columns of List Field
View gw-require-list-columns.php
<?php
/**
* Require All Columns of List Field
* http://gravitywiz.com/require-all-columns-of-list-field/
*/
class GWRequireListColumns {
private $field_ids;
public static $fields_with_req_cols = array();
@hereswhatidid
hereswhatidid / files.txt
Created Apr 17, 2018
Download a list of files via wget
View files.txt
https://placeimg.com/800/600/nature?cid=1
https://placeimg.com/800/600/nature?cid=2
https://placeimg.com/800/600/nature?cid=3
https://placeimg.com/800/600/nature?cid=4
https://placeimg.com/800/600/nature?cid=5
https://placeimg.com/800/600/nature?cid=6
https://placeimg.com/800/600/nature?cid=7
https://placeimg.com/800/600/nature?cid=8
https://placeimg.com/800/600/nature?cid=9
https://placeimg.com/800/600/nature?cid=10
@hereswhatidid
hereswhatidid / close-comments.sql
Created Nov 21, 2017
Set all comment statuses to closed in WordPress
View close-comments.sql
UPDATE wp_posts
SET comment_status = 'closed'
WHERE comment_status = 'open';
UPDATE wp_posts
SET ping_status = 'closed'
WHERE ping_status = 'open';
@hereswhatidid
hereswhatidid / acf-sample-options.php
Last active Apr 22, 2019
Set correct language for ACF options pages with custom post_id
View acf-sample-options.php
<?php
class ACF_SampleOptions_Page {
static $slug = 'sample_options_slug';
static $post_id = 'sample_options_id';
public static function init() {
@hereswhatidid
hereswhatidid / wp-sortable-column.php
Last active Oct 18, 2017
Add a custom, sortable column to a WordPress post type admin table
View wp-sortable-column.php
<?php
class HWID_Post_Sortable {
static $post_type_slug = 'post';
static function init() {
add_action( 'manage_' . self::$post_type_slug . '_posts_custom_column', array(
'HWID_Post_Sortable',
'sort_column_display',
@hereswhatidid
hereswhatidid / example-usage.php
Last active Sep 8, 2017
Plugin for adding any field as an attribute to the WooCommerce CSV import
View example-usage.php
<?php
function hwid333_add_custom_attribute_columns( $fields ) {
$fields[] = array(
'slug' => 'shirt-size',
'name' => 'Shirt Size', // This is the name of the column in the CSV
);
$fields[] = array(
@hereswhatidid
hereswhatidid / custom-package-name.php
Created Oct 18, 2016
Create custom shipping packages and manually set their display names in WooCommerce
View custom-package-name.php
<?php
add_filter( 'woocommerce_shipping_package_name', 'rmg_package_names', 10, 3 );
function rmg_package_names( $package_name, $i, $package ) {
if ( ! empty( $package['name'] ) ) {
$package_name = $package['name'];
}
@hereswhatidid
hereswhatidid / roundup-shipping.php
Created Sep 9, 2016
This snippet will round up all shipping rates in a WooCommerce store.
View roundup-shipping.php
<?php
add_filter( 'woocommerce_package_rates', 'roundup_rates', 10, 2 );
function roundup_rates( $rates, $package ) {
foreach( $rates as $key => $rate ) {
$rates[$key]->cost = ceil( $rate->cost );
}
return $rates;
}
View wooattributes-acf.php
<?php
class ACF_Product_Options {
static $slug = 'hwid_attributes';
public static function init() {
// Gather the global attribute types
$attribute_terms = wc_get_attribute_taxonomy_names();
@hereswhatidid
hereswhatidid / retina-media-query.css
Created May 9, 2016
Retina-specific media query
View retina-media-query.css
@media(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
/* Retina-specific stuff here */
}
You can’t perform that action at this time.