WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
228 | $term->add_data( array( 'status' => 400 ) ); |
229 | } |
230 |
|
231 | return $term; |
232 | } |
233 |
|
234 | $term = $this->get_term( $term ); |
235 |
|
236 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ |
237 | do_action( "rest_insert_{$this->taxonomy}", $term, $request, true ); |
238 |
|
239 | $schema = $this->get_item_schema(); |
240 | if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { |
241 | $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); |
242 |
|
243 | if ( is_wp_error( $meta_update ) ) { |
244 | return $meta_update; |
245 | } |
246 | } |
Line | Code |
312 |
|
313 | if ( is_wp_error( $update ) ) { |
314 | return $update; |
315 | } |
316 | } |
317 |
|
318 | $term = get_term( $term->term_id, $this->taxonomy ); |
319 |
|
320 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ |
321 | do_action( "rest_insert_{$this->taxonomy}", $term, $request, false ); |
322 |
|
323 | $schema = $this->get_item_schema(); |
324 | if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { |
325 | $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); |
326 |
|
327 | if ( is_wp_error( $meta_update ) ) { |
328 | return $meta_update; |
329 | } |
330 | } |