return all custom_taxonomy
337896
public function get_custom_taxonomies(){
    global $wpdb;

    $query = sprintf('SELECT * FROM %s ORDER BY id',MF_TABLE_CUSTOM_TAXONOMY);
    $custom_taxonomies = $wpdb->get_results( $query, ARRAY_A );
    return $custom_taxonomies;
  }
966493
def getAllViewsAsDict(self):
        """"""
        return {p: self._plugins[p].get_views() for p in self._plugins}
1354287
protected function get_term_ids( $taxonomy ) {
		$terms = get_the_terms( $this->get_id(), $taxonomy );

		if ( false === $terms || is_wp_error( $terms ) ) {
			return [];
		}

		return wp_list_pluck( $terms, 'term_id' );
	}
58609
private function empty_taxonomies() {
		global $wpdb;

		// Empty taxonomies and terms
		$terms      = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy" );
		$taxonomies = [];
		foreach ( (array) $terms as $term ) {
			$taxonomies[] = $term->taxonomy;
			wp_cache_delete( $term->term_id, $term->taxonomy );
		}

		$taxonomies = array_unique( $taxonomies );
		$cleaned    = [];
		foreach ( $taxonomies as $taxonomy ) {
			if ( isset( $cleaned[ $taxonomy ] ) ) {
				continue;
			}
			$cleaned[ $taxonomy ] = true;

			wp_cache_delete( 'all_ids', $taxonomy );
			wp_cache_delete( 'get', $taxonomy );
			delete_option( "{$taxonomy}_children" );
		}
		$wpdb->query( "TRUNCATE $wpdb->terms" );
		$wpdb->query( "TRUNCATE $wpdb->term_taxonomy" );
		$wpdb->query( "TRUNCATE $wpdb->term_relationships" );
		if ( ! empty( $wpdb->termmeta ) ) {
			$wpdb->query( "TRUNCATE $wpdb->termmeta" );
		}
	}
208538
public function getAllDimensions()
	{
		// Gather all arcrole types
		return array_reduce( $this->context->importedSchemas, function( $carry, /** @var XBRL $taxonomy */ &$taxonomy )
		{
			$dimensionNames = $taxonomy->getElementDimensions();
			$dimensionElements = array();

			foreach ( $dimensionNames as $dimensionName )
			{
				$element = $taxonomy->getElementByName( $dimensionName );
				$element['namespace'] = $taxonomy->getNamespace();
				$dimensionElements[ "{$taxonomy->getTaxonomyXSD()}#{$element['id']}" ] = $element;
			}

			$carry = array_merge( $carry, $dimensionElements );

			return $carry;
		}, array() );
	}
1031319
public static function get_terms( $the_post ) {
		$taxonomies = get_object_taxonomies( $the_post );

		$post_terms = [];

		foreach ( $taxonomies as $taxonomy ) {
			$post_terms[ $taxonomy ] = [];

			$terms = wp_get_post_terms( $the_post->ID, $taxonomy );

			foreach ( $terms as $term ) {
				$post_terms[ $taxonomy ][] = [
					'id' => $term->term_id,
					'name' => $term->name,
					'slug' => $term->slug,
					'description' => $term->description,
				];
			}
		}

		return $post_terms;
	}
482016
def all(self, lazy=False):
        
        return self.query_cls(self).build_ast()._execute(lazy)
290245
public function getTaxonomyValues()
    {
        if (!isset($_POST['tax']) || empty($_POST['tax'])) {
            echo '0';
            die();
        }

        $taxonomy = $_POST['tax'];
        $post = $_POST['post'];

        $result = array(
            'tax' => get_terms($taxonomy, array(
                'hide_empty' => false,
            )),
            'curr' => get_field('posts_taxonomy_value', $post)
        );

        echo json_encode($result);
        die();
    }
1020884
public function getTerms($taxonomy = null)
    {
        if ($taxonomy) {
            return (array_key_exists($taxonomy, $this->_terms))
                ? $this->_terms[$taxonomy]
                : array();
        }

        return $this->_terms;
    }
444704
public function getList()
    {
        if ($this->modelClass === TaxonomyTerm::class) {
            $list = parent::getList();
            return $list->filter('ParentID', '0');
        }
        return parent::getList();
    }
718548
public function new_custom_taxonomy($data){
    global $wpdb;

    // escape all the strings
    array_walk_recursive($data, array($this, 'escape_data'));

    $sql = $wpdb->prepare(
      "INSERT INTO " . MF_TABLE_CUSTOM_TAXONOMY .
      " (type, name, description, arguments, active)" .
      " values" .
      " (%s, %s, %s, %s, %d)",
      $data['core']['type'],
      $data['core']['name'],
      $data['core']['description'],
      serialize($data),
      1
    );

    $wpdb->query($sql);
    $custom_taxonomy_id = $wpdb->insert_id;
    return $custom_taxonomy_id;
  }
982141
private function checkTaxonomy()
    {
        foreach ($this->data['taxonomy'] as $key => $taxonomy) {
            if (empty($taxonomy['options']) || !is_array($taxonomy['options'])) {
                continue;
            }

            foreach ($taxonomy['options'] as $optionKey => $optionValue) {
                if (strpos($optionKey, '/') === false) {
                    continue;
                }

                $this->passed = false;
                $error = Trans::__(
                    'general.phrase.invalid-taxonomy-slug',
                    ['%taxonomy%' => $key, '%option%' => $optionValue]
                );
                $this->app['logger.flash']->error($error);
            }
        }

        return $this->passed;
    }
419544
public function getTaxonomies()
    {
        $tax = array();

        foreach (Hash::normalize($this->belongs_to) as $taxonomyName => $taxonomyConfig) {
            if (class_exists($taxonomyName)) {
                $tax[] = new $taxonomyName();
            } else {
                $tax[] = Taxonomy::factory($taxonomyName);
            }
        }

        return $tax;
    }
1245375
def build_taxonomy(self, level, namespace, predicate, value):
        
        return {
                'level': level,
                'namespace': namespace,
                'predicate': predicate,
                'value': value
                }
171137
public function get_terms( $taxonomy = '', $args = array() ) {
		if ( isset( $this->{$taxonomy} ) && empty( $args ) ) {
			return $this->{$taxonomy};
		} else {
			$name = $taxonomy . '_' . md5( json_encode( $args ) );
			if ( isset( $this->{$name} ) ) {
				return $this->{$name};
			}
			$data          = \wp_get_post_terms( $this->id(), $taxonomy, $args );
			$this->{$name} = $data;
			return $data;
		}
	}
187441
def get_categories(context, template='zinnia/tags/categories.html'):
    
    return {'template': template,
            'categories': Category.published.all().annotate(
                count_entries_published=Count('entries')),
            'context_category': context.get('category')}
420751
public function getAllTagsMap()
    {
        $tags = TaxonomyTerm::get()->filter(
            'Type.Name:ExactMatch',
            Config::inst()->get('DMSTaxonomyTypeExtension', 'default_record_name')
        );

        $map = array();
        foreach ($tags as $tag) {
            $nameParts = array($tag->Name);
            $currentTag = $tag;

            while ($currentTag->Parent() && $currentTag->Parent()->exists()) {
                array_unshift($nameParts, $currentTag->Parent()->Name);
                $currentTag = $currentTag->Parent();
            }

            $map[$tag->ID] = implode(' > ', $nameParts);
        }
        return $map;
    }