Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Last active June 25, 2018 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helgatheviking/023950868a3d6f40ffb82c44cf98c09c to your computer and use it in GitHub Desktop.
Save helgatheviking/023950868a3d6f40ffb82c44cf98c09c to your computer and use it in GitHub Desktop.
Remove thumbnail column from MNM product options
<?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