wp_update_term_data
Filter HookDescription
Filters term data before it is updated in the database.Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3360 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$data
|
Term data to be updated. |
int
|
$term_id
|
Term ID. |
string
|
$taxonomy
|
Taxonomy slug. |
array
|
$args
|
Arguments passed to wp_update_term(). |
Usage Examples
Basic Usage
<?php
// Hook into wp_update_term_data
add_filter('wp_update_term_data', 'my_custom_filter', 10, 4);
function my_custom_filter($data, $term_id, $taxonomy, $args) {
// Your custom filtering logic here
return $data;
}
Source Code Context
wp-includes/taxonomy.php:3360
- How this hook is used in WordPress core
<?php
3355 * @param array $data Term data to be updated.
3356 * @param int $term_id Term ID.
3357 * @param string $taxonomy Taxonomy slug.
3358 * @param array $args Arguments passed to wp_update_term().
3359 */
3360 $data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );
3361
3362 $wpdb->update( $wpdb->terms, $data, compact( 'term_id' ) );
3363
3364 if ( empty( $slug ) ) {
3365 $slug = sanitize_title( $name, $term_id );
PHP Documentation
<?php
/**
* Filters term data before it is updated in the database.
*
* @since 4.7.0
*
* @param array $data Term data to be updated.
* @param int $term_id Term ID.
* @param string $taxonomy Taxonomy slug.
* @param array $args Arguments passed to wp_update_term().
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.