term_id, 'display_type', true );
$image = '';
$thumbnail_id = absint( get_woocommerce_term_meta( $term->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;
}
$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;
}
add_filter( 'edit_posts_per_page', 'woocommerce_fix_edit_posts_per_page', 1, 2 );
/**
* Thumbnail column added to category admin.
*
* @access public
* @param mixed $columns
* @return void
*/
function woocommerce_product_cat_columns( $columns ) {
$new_columns = array();
$new_columns['cb'] = $columns['cb'];
$new_columns['thumb'] = __( 'Image', 'woocommerce' );
unset( $columns['cb'] );
return array_merge( $new_columns, $columns );
}
add_filter( 'manage_edit-product_cat_columns', 'woocommerce_product_cat_columns' );
/**
* Thumbnail column value added to category admin.
*
* @access public
* @param mixed $columns
* @param mixed $column
* @param mixed $id
* @return void
*/
function woocommerce_product_cat_column( $columns, $column, $id ) {
global $woocommerce;
if ( $column == 'thumb' ) {
$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();
$columns .= '';
}
return $columns;
}
add_filter( 'manage_product_cat_custom_column', 'woocommerce_product_cat_column', 10, 3 );
/**
* Add a configure button column for the shipping classes page.
*
* @access public
* @param mixed $columns
* @return void
*/
function woocommerce_shipping_class_columns( $columns ) {
$columns['edit'] = ' ';
return $columns;
}
add_filter( 'manage_edit-product_shipping_class_columns', 'woocommerce_shipping_class_columns' );
/**
* Add a configure button for the shipping classes page.
*
* @access public
* @param mixed $columns
* @param mixed $column
* @param mixed $id
* @return void
*/
function woocommerce_shipping_class_column( $columns, $column, $id ) {
if ( $column == 'edit' )
$columns .= ''.__( 'Edit Class', 'woocommerce' ).'';
return $columns;
}
add_filter( 'manage_product_shipping_class_custom_column', 'woocommerce_shipping_class_column', 10, 3 );