term_id, 'thumbnail_id', true );
if ($thumbnail_id) :
$image = wp_get_attachment_url( $thumbnail_id );
else :
$image = woocommerce_placeholder_img_src();
endif;
?>
|
|
id, '-')) {
$option = 'edit_' . str_replace('edit-', '', $screen->id) . '_per_page';
if (isset($_POST['wp_screen_options']['option']) && $_POST['wp_screen_options']['option'] == $option ) :
update_user_meta( get_current_user_id(), $option, $_POST['wp_screen_options']['value'] );
wp_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
exit;
endif;
$user_per_page = (int) get_user_meta( get_current_user_id(), $option, true );
if ($user_per_page) $per_page = $user_per_page;
}
return $per_page;
}
/**
* Thumbnail column for categories
*/
add_filter("manage_edit-product_cat_columns", 'woocommerce_product_cat_columns');
add_filter("manage_product_cat_custom_column", 'woocommerce_product_cat_column', 10, 3);
function woocommerce_product_cat_columns( $columns ) {
$new_columns = array();
$new_columns['cb'] = $columns['cb'];
$new_columns['thumb'] = __('Image', 'woocommerce');
unset($columns['cb']);
$columns = array_merge( $new_columns, $columns );
return $columns;
}
function woocommerce_product_cat_column( $columns, $column, $id ) {
if ($column=='thumb') :
global $woocommerce;
$image = '';
$thumbnail_id = get_woocommerce_term_meta( $id, 'thumbnail_id', true );
if ($thumbnail_id) :
$image = wp_get_attachment_url( $thumbnail_id );
else :
$image = woocommerce_placeholder_img_src();
endif;
$columns .= '';
endif;
return $columns;
}
/**
* Configure button for shipping classes page
*/
add_filter("manage_edit-product_shipping_class_columns", 'woocommerce_shipping_class_columns');
add_filter("manage_product_shipping_class_custom_column", 'woocommerce_shipping_class_column', 10, 3);
function woocommerce_shipping_class_columns( $columns ) {
$columns['configure'] = ' ';
return $columns;
}
function woocommerce_shipping_class_column( $columns, $column, $id ) {
if ($column=='configure') $columns .= ''.__('Configure shipping class', 'woocommerce').'';
return $columns;
}