Skip to content

Instantly share code, notes, and snippets.

View yayMark's full-sized avatar
💾
Gettin ma tech awn

Mark Hewitt yayMark

💾
Gettin ma tech awn
  • Perth, Western Australia
View GitHub Profile
// Callback function to remove default bio field from user profile page
// https://gist.github.com/dkomando/6214787a8d36d9f13c9b
if(!function_exists('remove_bio_box')){
function remove_bio_box($buffer){
$buffer = preg_replace('/<tr class=\"user-description-wrap\"[\s\S]*?<\/tr>/','',$buffer,1);
return $buffer;
}
function user_profile_subject_start(){ ob_start('remove_bio_box'); }
function user_profile_subject_end(){ ob_end_flush(); }
@yayMark
yayMark / wc25.php
Created July 10, 2016 01:02 — forked from corsonr/wc25.php
WooCommerce 2.5+: display custom variation fields
<div class="woocommerce-variation-custom-text-field">
{{{ data.variation.text_field }}}
</div>
@yayMark
yayMark / wc25.php
Created July 10, 2016 01:01 — forked from corsonr/wc25.php
WooCommerce 2.5+: add new variations settings
<?php
// Add New Variation Settings
add_filter( 'woocommerce_available_variation', 'load_variation_settings_fields' );
/**
* Add custom fields for variations
*
*/
function load_variation_settings_fields( $variations ) {
@yayMark
yayMark / gist:f00d590e0d5a50b080a39a22bab46a4f
Created July 9, 2016 23:48 — forked from corsonr/gist:3d0425deaa80c601d454
WooCommerce: custom variations settings
<?php
// Add Variation Settings
add_action( 'woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3 );
// Save Variation Settings
add_action( 'woocommerce_save_product_variation', 'save_variation_settings_fields', 10, 2 );
/**
* Create new fields for variations