Skip to content

Instantly share code, notes, and snippets.

View EricBusch's full-sized avatar

Eric Busch EricBusch

  • Owen Sound, Ontario
View GitHub Profile
@EricBusch
EricBusch / add_gender_attribute-04.php
Last active September 28, 2022 16:31
Automatically add the product's gender as a gender attribute from multiple fields and normalize the gender name. [datafeedr][dfrpswc]
<?php
/**
* Add the product's gender as a gender attribute for this product.
*
* The attribute "Gender" with a slug of "gender"
* must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
@EricBusch
EricBusch / add_gender_attribute-03.php
Last active September 28, 2022 16:30
Automatically add the product's gender as a gender attribute and normalize the gender name. [datafeedr][dfrpswc]
<?php
/**
* Add the product's gender as a gender attribute for this product.
*
* The attribute "Gender" with a slug of "gender"
* must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
@EricBusch
EricBusch / add_gender_attribute-02.php
Last active September 28, 2022 16:28
Automatically add the product's gender as a gender attribute from different product fields for this product. [datafeedr][dfrpswc]
<?php
/**
* Add the product's gender as a gender attribute for this product.
*
* The attribute "Gender" with a slug of "gender"
* must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
@EricBusch
EricBusch / add_gender_attribute-01.php
Last active September 28, 2022 16:27
Automatically add the product's gender as a gender attribute for this product. [datafeedr][dfrpswc]
<?php
/**
* Add the product's gender as a gender attribute for this product.
*
* The attribute "Gender" with a slug of "gender"
* must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
@EricBusch
EricBusch / add_color_attribute-05.php
Last active September 28, 2022 16:12 — forked from EricBusch/add_color_attribute-05.php
Automatically add the product's color as a color attribute from multiple fields with defaults and normalize the color name. [datafeedr][dfrpswc]
<?php
/**
* Add the product's color as a color attribute for this product.
*
* The attribute "Color" with a slug of "color" must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
* @param string $attribute The slug of the attribute. Examples: pa_color or pa_shoe-size
@EricBusch
EricBusch / add_color_attribute-04.php
Last active September 28, 2022 16:14 — forked from EricBusch/add_color_attribute-04.php
Automatically add the product's color as a color attribute from multiple fields and normalize the color name. [datafeedr][dfrpswc]
<?php
/**
* Add the product's color as a color attribute for this product.
*
* The attribute "Color" with a slug of "color" must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
* @param string $attribute The slug of the attribute. Examples: pa_color or pa_shoe-size
@EricBusch
EricBusch / add_color_attribute-03.php
Last active September 28, 2022 16:13 — forked from EricBusch/add_color_attribute-03.php
Automatically add the product's color as a color attribute and normalize the color name. [datafeedr][dfrpswc]
<?php
/**
* Add the product's color as a color attribute for this product.
*
* The attribute "Color" with a slug of "color" must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
* @param string $attribute The slug of the attribute. Examples: pa_color or pa_shoe-size
@EricBusch
EricBusch / add_size_attribute-02.php
Last active September 28, 2022 16:17 — forked from EricBusch/add_color_attribute-02.php
Automatically add the product's size as a size attribute from different product fields for this product. [datafeedr][dfrpswc]
<?php
/**
* Add the product's size as a size attribute for this product.
*
* The attribute "Size" with a slug of "size"
* must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
@EricBusch
EricBusch / add_size_attribute-01.php
Last active September 28, 2022 16:16 — forked from EricBusch/add_color_attribute-01.php
Automatically add the product's size as a size attribute for this product. [datafeedr][dfrpswc]
<?php
/**
* Add the product's size as a size attribute for this product.
*
* The attribute "Size" with a slug of "size" must already exist here:
* WordPress Admin Area > Products > Attributes.
*
* @param array|string $value The current value of the $attribute for this $post.
* @param string $attribute The slug of the attribute. Examples: pa_size or pa_shoe-size
@EricBusch
EricBusch / geargrabber.php
Created September 19, 2017 16:50
GearGrabber Custom Plugin - The following code is used on https://www.geargrabber.net/ to further customize various Datafeedr elements. [datafeedr]
<?php
/**
* Plugin Name: GearGrabber
* Plugin URI: https://www.geargrabber.net/
* Description: Custom code for https://www.geargrabber.net/
* Text Domain: geargrabber
* Domain Path: /languages
* Version: 1.0.12
*
* @package geargrabber