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 |
---|---|
1041 |
|
1042 | /** |
1043 | * Filters the Walker class used when adding nav menu items. |
1044 | * |
1045 | * @since 3.0.0 |
1046 | * |
1047 | * @param string $class The walker class to use. Default 'Walker_Nav_Menu_Edit'. |
1048 | * @param int $menu_id ID of the menu being rendered. |
1049 | */ |
1050 | $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); |
1051 |
|
1052 | if ( class_exists( $walker_class_name ) ) { |
1053 | $walker = new $walker_class_name; |
1054 | } else { |
1055 | return new WP_Error( |
1056 | 'menu_walker_not_exist', |
1057 | sprintf( |
1058 | /* translators: %s: Walker class name. */ |
1059 | __( 'The Walker class named %s does not exist.' ), |