I would like renaming words in WooCommerce status dashboard widget (see screenshot).
I use the following code and it works well for the title of the widget, but not for the marked words. What can be reason for that?
add_filter( 'gettext', 'change_add_to_cart_message22', 10, 3 );
function change_add_to_cart_message22( $translated, $text, $domain ) {
global $pagenow;
if( $text === 'on-hold' && $domain === 'woocommerce' && is_admin() && $pagenow === 'index.php' ){
$translated = __( 'test', $domain );
}
return $translated;
}
I also tried this, but the result it's not good. It overwrites not only the text but also the HTML used for the link.
jQuery( document ).ready(function() {
jQuery("#woocommerce_dashboard_status .wc_status_list li.processing-orders").text(function () {
return jQuery(this).text().replace("awaiting", "Websites:");
});
});
Any advice?