Looking at that code, I'd say that you should rework it into this:
PHP Code:
function bns_menu($menu, $args) {
if (is_home() || is_front_page()) {
$args['echo'] = false;
$args['depth'] = 1;
remove_filter('wp_page_menu','bns_menu',10,2);
$menu = wp_page_menu($args);
}
return $menu;
}
With this in the header:
PHP Code:
<? wp_page_menu('depth=1'); ?>
Why? Speed. With your code, you are forcing the page menu to generate twice on every page load. With mine, it only has to do that on the front page, other pages don't have to generate the page menu but once.
And honestly, your original solution was fine for a one-off. The only real reason to do something like this is if you want to make it easily configurable through a settings menu or put it in a plugin or something. If it's only for one site, and you're not releasing something with this code in it, then your original way is fastest, cleanest, and simplest. I was really only using your code as an example of how the filter worked, not to suggest a "right" way or anything.