Skip to content

Instantly share code, notes, and snippets.

View aolin480's full-sized avatar

Aaron Olin aolin480

View GitHub Profile
@aolin480
aolin480 / woocommerce-product-attribute-text-formatting.php
Last active September 27, 2015 19:06
Woocommerce Format product attributes by adding the "or" word for the last element in the array
<?php
// They could be pa_color, pa_flavor, pa_scent, it all depends how you named your product attribute
// all attributes are formated with the prefix pa_ *then your attrbute name*
// get the current product object to get the pa_size attributes, these might differ.
global $product;
// grab an array of product "size" attributes
$_sizes = wc_get_product_terms( $product->id, 'pa_size', array( 'fields' => 'names' ) );
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your