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?
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With