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 / Settings.php
Created Mar 21, 2019
WooCommerce custom settings page
View Settings.php
<?php
namespace RMG\QuoteBuilder;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( class_exists( 'RMG\QuoteBuilder\Settings_Quotes', false ) ) {
return new Settings_Quotes();
@hereswhatidid
hereswhatidid / custom-gut-category.php
Last active Mar 8, 2019
Register custom Gutenberg block category
View custom-gut-category.php
<?php
function new_category( $categories, $post ) {
return array_merge(
$categories,
array(
array(
'slug' => 'custom-category',
'title' => __( 'Custom Category', 'language' ),
),
)
@hereswhatidid
hereswhatidid / bashrc.sh
Last active Feb 18, 2019
Run lighthouse from a bashrc function. ex: "lh https://mynewsite.com"
View bashrc.sh
lh() {
lighthouse "$1" --view --chrome-flags="--headless" --config-path="$HOME/lighthouse-config.js"
}
@hereswhatidid
hereswhatidid / acf-gf-dropdown.php
Last active Jul 22, 2019
Populate ACF drop down with Gravity Forms forms
View acf-gf-dropdown.php
<?php
namespace HWID\ACFGravity;
class ACF_GF_DropDown {
public static function init() {
add_filter( 'acf/load_field/key=FIELDKEY', [ 'HWID\ACFGravity\ACF_GF_DropDown', 'populate_gform_dropdown' ] );
@hereswhatidid
hereswhatidid / woo-product-schema.php
Created Sep 11, 2018
Customize the schema for WooCommerce products
View woo-product-schema.php
<?php
/*
* This class will customize the WooCommerce product schema markup
*/
namespace HWID\Woo;
class CustomizeSchema {
static function init() {
add_filter( 'woocommerce_structured_data_product', [ 'HWID\Woo\CustomizeSchema', 'override_schema_markup' ], 10, 2 );
}
@hereswhatidid
hereswhatidid / disable-yoast-cpt.php
Created Aug 16, 2018
Disable Yoast fields on a custom post type
View disable-yoast-cpt.php
<?php
/*
* This class will disable Yoast SEO fields on the edit screen for a particular post type
*/
namespace HWID\CustomPostType;
class DisableYoast {
static function init() {
// The important aspect of this add_action is to make sure it's set to at least 11 in priority
add_action( 'add_meta_boxes', [ 'HWID\CustomPostType\Expertise', 'remove_yoast' ], 11 );
@hereswhatidid
hereswhatidid / variations-link-chooser.php
Created Aug 14, 2018
Add WooCommerce product variations to the WordPress Link Chooser
View variations-link-chooser.php
@hereswhatidid
hereswhatidid / gforms-merge-tag.php
Last active Jul 26, 2018
Create a custom Gravity Forms merge tag
View gforms-merge-tag.php
<?php
namespace HWID\SampleCode;
class GravityForms {
public static function init() {
add_filter( 'gform_custom_merge_tags', [ 'HWID\SampleCode\GravityForms', 'custom_merge_tags' ], 10, 4 );
add_filter( 'gform_replace_merge_tags', [ 'HWID\SampleCode\GravityForms', 'replace_merge_tags' ], 10, 3 );
}
/**
@hereswhatidid
hereswhatidid / _gravity-forms.less
Created Jun 20, 2018
Gravity Forms basic styling via LESS
View _gravity-forms.less
.gform_wrapper {
@fieldBorder: @lightGray;
@fieldBg: @xLightBlue;
@focusBorder: @aqua;
@focusBg: @white;
@fieldGutter: 14px;
@halfGutter: @fieldGutter / 2;
@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();
You can’t perform that action at this time.