#29: wp_edit_nav_menu_walker

The wp_edit_nav_menu_walker filter allows you to change the Walker class used when adding menu items.

It was added in 3.4.

It is evaluated in wp_ajax_add_menu_item() in the wp-admin/includes/ajax-actions.php file.

wp_edit_nav_menu_walker accepts 2 arguments:

  1. string $class The Walker class to use when adding menu items. Default is ‘Walker_Nav_Menu_Edit’
  2. int $menu_id The menu id. Uses the value of $_POST['menu'].

Example:

The following example changes the Walker class used when adding new menu items. Note: This example does not include the custom Walker class, it’s just an example to demonstrate how to tell WordPress to use your class instead of Walker_Nav_Menu_Edit.

View the code example on Gist.

#28: autocomplete_users_for_site_admins

The autocomplete_users_for_site_admins filter allows you to enable user auto-complete for non-super admins in Multisite.

It was added in 3.4.

It is evaluated in wp_ajax_autocomplete_user() in the wp-admin/includes/ajax-actions.php file.

autocomplete_users_for_site_admins accepts a single argument:

  1. bool true|false Whether to die() for non-super admin users. Default is false.

Example:

The following example would enable user auto-complete in Multisite for users with the promote_users capability.

View the code example on Gist.

#27: heartbeat_nopriv_send

The heartbeat_nopriv_send filter allows you to modify the Heartbeat response sent when no $_POST data is passed.

It was added in 3.6.

It is evaluated in wp_ajax_nopriv_heartbeat in the wp-admin/includes/ajax-actions.php file.

heartbeat_nopriv_send accepts 2 arguments:

  1. array|object $response The response object or array.
  2. string $screen_id The screen id

Example:

There is no example for this filter yet. Have an idea for one? Submit an example.