Last active
June 25, 2018 17:18
-
-
Save helgatheviking/023950868a3d6f40ffb82c44cf98c09c to your computer and use it in GitHub Desktop.
Remove thumbnail column from MNM product options
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 | |
/** | |
* Remove thumbnail column from MNM product options | |
* The table column header must be removed by overriding the single-product/mnm/tablular/mnm-items-wrapper-open.php template | |
*/ | |
function kia_remove_thumbnail_column() { | |
remove_action( 'woocommerce_mnm_child_item_details', 'wc_mnm_template_child_item_thumbnail_open', 10 ); | |
remove_action( 'woocommerce_mnm_child_item_details', 'wc_mnm_template_child_item_thumbnail', 20 ); | |
remove_action( 'woocommerce_mnm_child_item_details', 'wc_mnm_template_child_item_section_close', 30 ); | |
add_filter( 'woocommerce_mnm_tabular_column_headers', 'kia_remove_thumbnail_column_header' ); | |
} | |
add_action( 'woocommerce_before_mnm_items', 'kia_remove_thumbnail_column', -10 ); | |
/** | |
* Remove thumbnail column from MNM table header | |
* @param array | |
* @return array | |
*/ | |
function kia_remove_thumbnail_column_header( $headers ) { | |
if( isset( $headers['thumbnail'] ) ) { | |
unset( $headers['thumbnail'] ); | |
} | |
return $headers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment