Hi there Gabriel,
Looks correct to me – and if I add it on a test site, within a child theme’s functions.php file, it works as expected.
However, a WordPress site can be a complicated system – especially when lots of other plugins and non-default themes are running, all of which can also influence the end result.
Do you have a clean test site where you can try it out (ie, nothing but the latest versions of our plugins and a default theme like Twenty Fifteen)? If it doesn’t work even there we can probably take another look at this 🙂