Thanks tinkerpriest! I had the same problem and it worked perfectly 😉
It was needed to require again the config.php
require(ABSPATH."wp-config.php");
The function that replaces to dashes is: sanitize_title_with_dashes, which is located in wp-includes/formatting.php
Hi stvwlf,
If the tag is named “Test1 | Test2” there is no problem, it generates the slug “test1-test2”. The problem comes when the tag is named “Test1|Test2”, because then the slug generated is “test1test2”.
If you have any ideas, I’ll appreciate it.