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
95       * returning that value otherwise.
96       *
97       * @since 3.9.0
98       *
99       * @see wp_nav_menu()
100       *
101       * @param string|null $output Nav menu output to short-circuit with. Default null.
102       * @param stdClass    $args   An object containing wp_nav_menu() arguments.
103       */
104      $nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );
105
106      if ( null !== $nav_menu ) {
107           if ( $args->echo ) {
108                echo $nav_menu;
109                return;
110           }
111
112           return $nav_menu;
113      }