wp_import_term_meta

Filters the metadata attached to an imported term.

Description

apply_filters( 'wp_import_term_meta', (array) $term_termmeta, (int) $term_id, (array) $term ); 

Parameters (3)

0. $term_termmeta (array)
Array of term meta.
1. $term_id (int)
ID of the newly created term.
2. $term (array)
Term data from the WXR import.

Usage

To run the hook, copy the example below.
  1. $term_termmeta = apply_filters( 'wp_import_term_meta', $term_termmeta, $term_id, $term ); 
  2.  
  3. if ( !empty( $term_termmeta ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_import_term_meta callback 
  2. function filter_wp_import_term_meta( $term_termmeta, $term_id, $term ) { 
  3. // make filter magic happen here... 
  4. return $term_termmeta
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_import_term_meta', 'filter_wp_import_term_meta', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_import_term_meta', 'filter_wp_import_term_meta', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wordpress-importer.php  
  1. $term['termmeta'] = apply_filters( 'wp_import_term_meta', $term['termmeta'], $term_id, $term );