I have this php script that updates my product titles:
add_filter( 'the_title', 'change_product_title', 10, 2 );
function change_product_title( $title, $id ) {
$Find = 'Mens Watch';
$ReplaceWith = 'Herreur';
//REMOVE DESIRED STRING FROM PRODUCT TITLE
$title = str_replace($Find, $ReplaceWith, $title);
return $title;
}
And it updates the title in every product title. But how can I make it so every word that has $find = ?? Gets replaced? And also, how can I add more words to the script so they also are replaced on my site?
Thanks!