WP HOOKS
akcjadynamicznyod 4.7.0

rest_insert_{$this->taxonomy}

Args 3Plik wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

Opis — z kodu źródłowego

Fires after a single term is created or updated via the REST API.

The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug. Possible hook names include:

  • rest_insert_category
  • rest_insert_post_tag

Hook dynamiczny — możliwe nazwy

rest_insert_categoryrest_insert_post_tag

Parametry

ParametrTypOpis
$term\WP_TermInserted or updated term object.
$request\WP_REST_RequestRequest object.
$creatingboolTrue when creating a term, false when updating.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'rest_insert_{$this->taxonomy}', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii