wp_term_is_shared

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

WordPress Version: 6.2

/**
 * Determines whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
 * other delays in upgrade routines may cause shared terms to remain.
 *
 * @since 4.4.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $term_id Term ID.
 * @return bool Returns false if a term is not shared between multiple taxonomies or
 *              if splitting shared taxonomy terms is finished.
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}

WordPress Version: 6.1

/**
 * Determines whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
 * other delays in upgrade routines may cause shared terms to remain.
 *
 * @since 4.4.0
 *
 * @param int $term_id Term ID.
 * @return bool Returns false if a term is not shared between multiple taxonomies or
 *              if splitting shared taxonomy terms is finished.
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}

WordPress Version: 5.2

/**
 * Determine whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
 * other delays in upgrade routines may cause shared terms to remain.
 *
 * @since 4.4.0
 *
 * @param int $term_id Term ID.
 * @return bool Returns false if a term is not shared between multiple taxonomies or
 *              if splitting shared taxonomy terms is finished.
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}

WordPress Version: 4.9

/**
 * Determine whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
 * other delays in upgrade routines may cause shared terms to remain.
 *
 * @since 4.4.0
 *
 * @param int $term_id Term ID.
 * @return bool Returns false if a term is not shared between multiple taxonomies or
 *              if splittng shared taxonomy terms is finished.
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}

WordPress Version: 4.8

/**
 * Determine whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
 * other delays in upgrade routines may cause shared terms to remain.
 *
 * @since 4.4.0
 *
 * @param int $term_id
 * @return bool
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}

WordPress Version: 4.4

/**
 * Determine whether a term is shared between multiple taxonomies.
 *
 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or other delays in upgrade routines may cause
 * shared terms to remain.
 *
 * @since 4.4.0
 *
 * @param int $term_id
 * @return bool
 */
function wp_term_is_shared($term_id)
{
    global $wpdb;
    if (get_option('finished_splitting_shared_terms')) {
        return false;
    }
    $tt_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_taxonomy} WHERE term_id = %d", $term_id));
    return $tt_count > 1;
}