Can the wp_filter object hold multiple values with the same key

Firstly, keep in mind that the structure of $wp_filter was changed in WordPress 4.7: https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/ As for your questions: Is this possible? Yes. Under what circumstances would this occur? If multiple functions have been hooked to the same action/filter, eg: add_action( ‘save_post’, ‘do_a_thing’ ); add_action( ‘save_post’, ‘do_another_thing’ ); In that case $wp_filter[‘save_post’] will have multiple … Read more

Which are the hooks run before/after when a category’s deletion?

wp_delete_category() is a small wrapper around wp_delete_term() ( source ). It has number of hooks, the one that comes right before delete is: do_action( ‘delete_term_taxonomy’, $tt_id ); Hooks after delete: do_action( ‘deleted_term_taxonomy’, $tt_id ); do_action(‘delete_term’, $term, $tt_id, $taxonomy); do_action(“delete_$taxonomy”, $term, $tt_id); There are also few earlier hooks that deal with remapping children terms.

Proper indentation of code generated inside hooks

I don’t think correct global indentation is possible without massive (and inefficient) output buffering to change it. Since you are primarily interested in this for debug purposes I suggest using some tool that will format and color-code output (of any page btw, not just those that you control). Firebug and View Source Chart work nicely … Read more