Mensaje de salida de WordPress

Quiero el texto antes del botón, ¿alguien sabe cómo?

aquí está el código

función wc_add_to_cart_message ($ product_id) {$ titles = array ();

if ( is_array( $product_id ) ) { foreach ( $product_id as $id ) { $titles[] = get_the_title( $id ); } } else { $titles[] = get_the_title( $product_id ); } $titles = array_filter( $titles ); $added_text = sprintf( _n ( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s has been added to your cart.', 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s have been added to your cart.', sizeof( $titles ), 'woocommerce' ), wc_format_list_of_items( $titles ) ); // Output success messages if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) { $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wp_get_referer() ? wp_get_referer() : home_url() ); $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s https://stackoverflow.com/questions/35023294/wordpress-output-message/%s', esc_url( $return_to ), esc_html__( 'Continue Shopping', 'woocommerce' ), esc_html( $added_text ) ); } else { $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%shttps://stackoverflow.com/questions/35023294/wordpress-output-message/%s', esc_url( wc_get_page_permalink( 'cart' ) ), esc_html__( 'View Cart', 'woocommerce' ), esc_html( $added_text ) ); } wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) ); 

}

PREGUNTA 2

función wc_add_to_cart_message ($ product_id) {$ titles = array ();

 if ( is_array( $product_id ) ) { foreach ( $product_id as $id ) { $titles[] = get_the_title( $id ); } } else { $titles[] = get_the_title( $product_id ); } $titles = array_filter( $titles ); $added_text = sprintf( _n( '**DIV HERE** https://stackoverflow.com/questions/35023294/wordpress-output-message/%s has been added to your cart.', '**DIV HERE** https://stackoverflow.com/questions/35023294/wordpress-output-message/%s have been added to your cart.', sizeof( $titles ), 'woocommerce' ), wc_format_list_of_items( $titles ) ); // Output success messages if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) { $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wp_get_referer() ? wp_get_referer() : home_url() ); $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s https://stackoverflow.com/questions/35023294/wordpress-output-message/%s ', esc_html( $added_text ), esc_url( $return_to ), esc_html__( 'Continue Shopping', 'woocommerce' ) ); } else { $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s https://stackoverflow.com/questions/35023294/wordpress-output-message/%s', esc_html( $added_text ), esc_url( wc_get_page_permalink( 'cart' ) ), esc_html__( 'View Cart', 'woocommerce' ) ); } wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) ); 

}

Esto debería funcionar. Prueba esto

 // Output success messages if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) { $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wp_get_referer() ? wp_get_referer() : home_url() ); $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s https://stackoverflow.com/questions/35023294/wordpress-output-message/%s ', esc_html( $added_text ), esc_url( $return_to ), esc_html__( 'Continue Shopping', 'woocommerce' ) ); } else { $message = sprintf( 'https://stackoverflow.com/questions/35023294/wordpress-output-message/%s https://stackoverflow.com/questions/35023294/wordpress-output-message/%s', esc_html( $added_text ), esc_url( wc_get_page_permalink( 'cart' ) ), esc_html__( 'View Cart', 'woocommerce' ) ); } wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) ); 

Pregunta # 2 Respuesta

  // Output success messages if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) { $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wp_get_referer() ? wp_get_referer() : home_url() ); $message = sprintf( '
https://stackoverflow.com/questions/35023294/wordpress-output-message/%s
https://stackoverflow.com/questions/35023294/wordpress-output-message/%s ', esc_html( $added_text ), esc_url( $return_to ), esc_html__( 'Continue Shopping', 'woocommerce' ) ); } else { $message = sprintf( '
https://stackoverflow.com/questions/35023294/wordpress-output-message/%s
https://stackoverflow.com/questions/35023294/wordpress-output-message/%s', esc_html( $added_text ), esc_url( wc_get_page_permalink( 'cart' ) ), esc_html__( 'View Cart', 'woocommerce' ) ); } wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) );