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.

how to determine how many and what kind of arguments are passed to hooks

When calling an action hook using add_action(‘some_action_tag’,’callback_function’,$priority,$number_of_arguments); The callback function is called when a do_action() call is fired with the corresponding tag for example: do_action(‘some_action_tag’,$argument1,$argument2,$argument3….); And when calling a filter hook using: add_filter(‘some_filter_tag’,’callback_function’,$priority,$number_of_arguments); The callback function is called when a apply_filters() call is fired with the corresponding tag for example: $value = apply_filters(‘some_filter_tag’,$argument1,$argument2,$argument3…); Now as … Read more