3

I'm new to wordpress and php. I saw the line of code:

wp_nav_menu( array( 'theme_location' => 'primary' ) );

I understand that it is a generating my nav menu, but I would really like to get in there and change things.

Where is the array defined, and what is this => operator? What is this array access doing?

MedicineMan
  • 15,008
  • 32
  • 101
  • 146

1 Answers1

3

This just passes a "primary" into the wp_nav_menu() function. And the => is quite simply the syntax for declaring arrays. It's a array declaration, not an access.

See also the manual http://php.net/manual/en/language.types.array.php
or Reference - What does this symbol mean in PHP?
and What does "=>" mean in PHP?

Community
  • 1
  • 1
mario
  • 144,265
  • 20
  • 237
  • 291