Working with WordPress and looking at code examples, I've seen two different ways of using arrays with functions:
1. Define the array first, then pass it into the function as a parameter
$args = array(
'name' => 'Home right sidebar',
'id' => 'home_right_1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
);
register_sidebar( $args );
2. Define the array as part of the function call
register_sidebar( array(
'name' => 'Home right sidebar',
'id' => 'home_right_1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
Is it bad practice to define an array as part of a function call (#2) or is it a style choice?
If it's bad practice, why?