WP HOOKS
filtrdynamicznyod 4.7.0

rest_pre_insert_{$this->taxonomy}

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

Opis — z kodu źródłowego

Filters term data before inserting term via the REST API.

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

  • rest_pre_insert_category
  • rest_pre_insert_post_tag

Hook dynamiczny — możliwe nazwy

rest_pre_insert_categoryrest_pre_insert_post_tag

Parametry

ParametrTypOpis
$prepared_termobjectTerm object.
$request\WP_REST_RequestRequest object.

Wywołanie

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

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

Popularne w tej kategorii