rest_after_insert_(taxonomy) хук-событие . WP 5.0.0
Fires after a single term is completely created or updated via the REST API.
The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug.
Использование
add_action( 'rest_after_insert_(taxonomy)', 'action_function_name_5173', 10, 3 ); function action_function_name_5173( $term, $request, $creating ){ // action... }
- $term(WP_Term)
- Inserted or updated term object.
- $request(WP_REST_Request)
- Request object.
- $creating(true/false)
- True when creating a term, false when updating.
Список изменений
С версии 5.0.0 | Введена. |
Где вызывается хук
rest_after_insert_(taxonomy)
rest_after_insert_(taxonomy)
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 514
do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true );
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 619
do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, false );