Overriding wp_nav_menu default arguments

If you want the options to be extensible by developers, just add a custom filter to the output:

wp_nav_menu( apply_filters( 'wpse119371_nav_menu_args', array(
    'theme_location' => 'primary',
    'container' => false,
    // etc.
) ) );

Then, a developer merely has to add a filter callback:

function wpse119371_filter_nav_menu_args( $args ) {
    // Modify $args
    $args['container'] => 'div';
    // etc.

    // Return
    return $args;
}
add_filter( 'wpse119371_nav_menu_args', 'wpse119371_filter_nav_menu_args' );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)