Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_wp_nav_menu

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
79       * returning that value otherwise.
80       *
81       * @since 3.9.0
82       *
83       * @see wp_nav_menu()
84       *
85       * @param string|null $output Nav menu output to short-circuit with. Default null.
86       * @param stdClass    $args   An object containing wp_nav_menu() arguments.
87       */
88      $nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );
89
90      if ( null !== $nav_menu ) {
91           if ( $args->echo ) {
92                echo $nav_menu;
93                return;
94           }
95
96           return $nav_menu;
97      }