Why do you want to add slashes to the $_POST array? You shouldn't need to do it to everything unless you're doing something "wrong".
So what is the reason that you need every POST item passed through addslashes?
Secondly, your code expects a function name, not a function:
$_POST = array_walk($_POST, 'addslashes');