Update woocommerce_get_formatted_product_name use

To use new WC_Product::get_formatted_name() function. For #2788
This commit is contained in:
Brent Shepherd 2013-03-27 17:58:48 +10:00
parent 9431f82a24
commit 9e71cd699f
4 changed files with 10 additions and 15 deletions

View File

@ -79,10 +79,9 @@ function woocommerce_coupon_data_meta_box( $post ) {
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
foreach ( $product_ids as $product_id ) {
$product = get_product( $product_id );
$product_name = woocommerce_get_formatted_product_name( $product );
$product = get_product( $product_id );
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . wp_kses_post( $product_name ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
}
}
?>
@ -99,10 +98,9 @@ function woocommerce_coupon_data_meta_box( $post ) {
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
foreach ( $product_ids as $product_id ) {
$product = get_product( $product_id );
$product_name = woocommerce_get_formatted_product_name( $product );
$product = get_product( $product_id );
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
}
}
?>

View File

@ -76,9 +76,8 @@ function woocommerce_order_downloads_meta_box() {
if ( $products ) foreach ( $products as $product ) {
$product_object = get_product( $product->ID );
$product_name = woocommerce_get_formatted_product_name( $product_object );
echo '<option value="' . esc_attr( $product->ID ) . '">' . esc_html( $product_name ) . '</option>';
echo '<option value="' . esc_attr( $product->ID ) . '">' . esc_html( $product_object->get_formatted_name() ) . '</option>';
}
?>

View File

@ -526,10 +526,9 @@ function woocommerce_product_data_box() {
if ( $product_ids ) {
foreach ( $product_ids as $product_id ) {
$product = get_product( $product_id );
$product_name = woocommerce_get_formatted_product_name( $product );
$product = get_product( $product_id );
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
}
}
?>
@ -543,10 +542,9 @@ function woocommerce_product_data_box() {
if ( $product_ids ) {
foreach ( $product_ids as $product_id ) {
$product = get_product( $product_id );
$product_name = woocommerce_get_formatted_product_name( $product );
$product = get_product( $product_id );
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
}
}
?>

View File

@ -1607,7 +1607,7 @@ function woocommerce_json_search_products( $x = '', $post_types = array('product
$product = get_product( $post );
$found_products[ $post ] = woocommerce_get_formatted_product_name( $product );
$found_products[ $post ] = $product->get_formatted_name();
}