This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="woocommerce-variation-custom-text-field"> | |
{{{ data.variation.text_field }}} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |