Mlp_Term_Translation::get_term_by_term_taxonomy_id PHP Méthode

get_term_by_term_taxonomy_id() private méthode

Get a term by its term taxonomy ID.
private get_term_by_term_taxonomy_id ( integer $term_taxonomy_id ) : array
$term_taxonomy_id integer Term taxonomy ID.
Résultat array
    private function get_term_by_term_taxonomy_id($term_taxonomy_id)
    {
        $cache_key = $this->get_term_by_term_taxonomy_id_cache_key($term_taxonomy_id);
        $term = wp_cache_get($cache_key, 'mlp');
        if (is_array($term)) {
            return $term;
        }
        $query = "\nSELECT t.term_id, t.name, tt.taxonomy\nFROM {$this->wpdb->terms} t, {$this->wpdb->term_taxonomy} tt\nWHERE tt.term_id = t.term_id AND tt.term_taxonomy_id = %d\nLIMIT 1";
        $query = $this->wpdb->prepare($query, $term_taxonomy_id);
        $term = $this->wpdb->get_row($query, ARRAY_A);
        if (!$term) {
            $term = [];
        }
        wp_cache_set($cache_key, $term, 'mlp');
        return $term;
    }