Skip to content

Commit

Permalink
Merge pull request #1982 from misulicus/patch-24
Browse files Browse the repository at this point in the history
Fixes category image in te2 and te1
  • Loading branch information
JustinSainton committed Aug 24, 2015
2 parents 0cb555c + ecf858f commit 9416de0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wpsc-admin/includes/save-data.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ function wpsc_custom_category_column_data( $string, $column_name, $term_id ) {
if ( 'image' == $column_name ) {
$term = get_term_by( 'id', $term_id, 'wpsc_product_category' );
$image = wpsc_get_categorymeta( $term_id, 'image' );
$noimage = defined( 'WPSC_CORE_THEME_URL' ) ? WPSC_CORE_THEME_URL . '/wpsc-images/noimage.png' : WPSC_TE_V2_URL . '/theming/assets/images/noimage.png';

$format = '<img src="%s" title="%s" alt="%2$s" width="30" height="30" />';
if ( ! empty( $image ) ) {
$string = sprintf( $format, WPSC_CATEGORY_URL . $image, esc_attr( $term->name ) );
} else {
$string = sprintf( $format, WPSC_CORE_THEME_URL . 'wpsc-images/noimage.png', esc_attr( $term->name ) );
$string = sprintf( $format, $noimage, esc_attr( $term->name ) );
}
}
return $string;
Expand Down

0 comments on commit 9416de0

Please sign in to comment.