wp_get_split_term

Get the new term ID corresponding to a previously split term.

Description

(int|false) wp_get_split_term( (int) $old_term_id, (string) $taxonomy ); 

Returns (int|false)

If a previously split term is found corresponding to the old term_id and taxonomy, the new term_id will be returned. If no previously split term is found matching the parameters, returns false.

Parameters (2)

0. $old_term_id (int)
Term ID. This is the old, pre-split term ID.
1. $taxonomy (string)
Taxonomy that the term belongs to.

Usage

  1. if ( !function_exists( 'wp_get_split_term' ) ) { 
  2. require_once ABSPATH . WPINC . '/taxonomy.php'; 
  3.  
  4. // Term ID. This is the old, pre-split term ID. 
  5. $old_term_id = -1; 
  6.  
  7. // Taxonomy that the term belongs to. 
  8. $taxonomy = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_get_split_term($old_term_id, $taxonomy); 
  12.  

Defined (1)

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

/wp-includes/taxonomy.php  
  1. function wp_get_split_term( $old_term_id, $taxonomy ) { 
  2. $split_terms = wp_get_split_terms( $old_term_id ); 
  3.  
  4. $term_id = false; 
  5. if ( isset( $split_terms[ $taxonomy ] ) ) { 
  6. $term_id = (int) $split_terms[ $taxonomy ]; 
  7.  
  8. return $term_id;