wp_get_split_term

The timeline below displays how wordpress function wp_get_split_term has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Gets the new term ID corresponding to a previously split term.
 *
 * @since 4.2.0
 *
 * @param int    $old_term_id Term ID. This is the old, pre-split term ID.
 * @param string $taxonomy    Taxonomy that the term belongs to.
 * @return 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.
 */
function wp_get_split_term($old_term_id, $taxonomy)
{
    $split_terms = wp_get_split_terms($old_term_id);
    $term_id = false;
    if (isset($split_terms[$taxonomy])) {
        $term_id = (int) $split_terms[$taxonomy];
    }
    return $term_id;
}

WordPress Version: 4.3

/**
 * Get the new term ID corresponding to a previously split term.
 *
 * @since 4.2.0
 *
 * @param int    $old_term_id Term ID. This is the old, pre-split term ID.
 * @param string $taxonomy    Taxonomy that the term belongs to.
 * @return 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.
 */
function wp_get_split_term($old_term_id, $taxonomy)
{
    $split_terms = wp_get_split_terms($old_term_id);
    $term_id = false;
    if (isset($split_terms[$taxonomy])) {
        $term_id = (int) $split_terms[$taxonomy];
    }
    return $term_id;
}

WordPress Version: 4.2

/**
 * Get the new term ID corresponding to a previously split term.
 *
 * @since 4.2.0
 *
 * @param int    $old_term_id Term ID. This is the old, pre-split term ID.
 * @param string $taxonomy    Taxonomy that the term belongs to.
 * @return bool|int 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.
 */
function wp_get_split_term($old_term_id, $taxonomy)
{
    $split_terms = wp_get_split_terms($old_term_id);
    $term_id = false;
    if (isset($split_terms[$taxonomy])) {
        $term_id = (int) $split_terms[$taxonomy];
    }
    return $term_id;
}