delete_category хук-событиеWP 2.3.0

Fires after a term in a specific taxonomy is deleted.

Это один из вариантов динамического хука delete_(taxonomy)

Использование

add_action( 'delete_category', 'wp_kama_delete_category_action', 10, 4 );

/**
 * Function for `delete_category` action-hook.
 * 
 * @param int     $term         Term ID.
 * @param int     $tt_id        Term taxonomy ID.
 * @param WP_Term $deleted_term Copy of the already-deleted term.
 * @param array   $object_ids   List of term object IDs.
 *
 * @return void
 */
function wp_kama_delete_category_action( $term, $tt_id, $deleted_term, $object_ids ){

	// action...
}
$term(int)
Term ID.
$tt_id(int)
Term taxonomy ID.
$deleted_term(WP_Term)
Copy of the already-deleted term.
$object_ids(массив)
List of term object IDs.

Список изменений

С версии 2.3.0 Введена.
С версии 4.5.0 Introduced the $object_ids argument.

Где вызывается хук

wp_delete_term()
delete_category
wp-includes/taxonomy.php 2155
do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );

Где используется хук в WordPress

Использование не найдено.