delete_term хук-событие . WP 2.5.0
Fires after a term is deleted from the database and the cache is cleaned.
The 'delete_(taxonomy)' hook is also available for targeting a specific taxonomy.
Использование
add_action( 'delete_term', 'action_function_name_1012', 10, 5 ); function action_function_name_1012( $term, $tt_id, $taxonomy, $deleted_term, $object_ids ){ // action... }
- $term(число)
- Term ID.
- $tt_id(число)
- Term taxonomy ID.
- $taxonomy(строка)
- Taxonomy slug.
- $deleted_term(WP_Term)
- Copy of the already-deleted term.
- $object_ids(массив)
- List of term object IDs.
Список изменений
С версии 2.5.0 | Введена. |
С версии 4.5.0 | Introduced the $object_ids argument. |
Где вызывается хук
delete_term
wp-includes/taxonomy.php 2004
do_action( 'delete_term', $term, $tt_id, $taxonomy, $deleted_term, $object_ids );
Где используется хук в ядре WordPress
wp-includes/taxonomy.php 391
add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 );