WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
222 |
|
223 | $args = wp_parse_args( $args, $defaults ); |
224 | /** |
225 | * Filter the arguments used to display a navigation menu. |
226 | * |
227 | * @since 3.0.0 |
228 | * |
229 | * @param array $args Arguments from {@see wp_nav_menu()}. |
230 | */ |
231 | $args = apply_filters( 'wp_nav_menu_args', $args ); |
232 | $args = (object) $args; |
233 |
|
234 | // Get the nav menu based on the requested menu |
235 | $menu = wp_get_nav_menu_object( $args->menu ); |
236 |
|
237 | // Get the nav menu based on the theme_location |
238 | if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) |
239 | $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); |
240 |
|