Creates a custom taxonomy.

@param WP_Taxonomy_Options $options Properties to create a new taxonomy.
436904
public function create_taxonomy( $options ) {

        // Ensure we have the correct options.
        if ( ! $options instanceof WP_Taxonomy_Options ) {

            // Trigger error.
            trigger_error( 'Options must be passed as a WP_Taxonomy_Options.' );

            // Exit.
            return;

        }

        // Ensure we have all the properties required.
        if ( ! $options->has_required_properties() ) {

            // Trigger error.
            trigger_error( 'WP_Taxonomy_Options are missing required properties.' );

            // Exit.
            return;

        }

        // Create labels.
        $labels = array(
            'add_new_item'      => __( 'Add New ' . $options->get_singular_name() ),
            'all_items'         => __( 'All ' . $options->get_plural_name() ),
            'edit_item'         => __( 'Edit ' . $options->get_singular_name() ),
            'menu_name'         => __( $options->get_plural_name() ),
            'name'              => __( $options->get_plural_name() ),
            'new_item_name'     => __( 'New ' . $options->get_singular_name() . ' Name' ),
            'parent_item'       => __( 'Parent ' . $options->get_singular_name() ),
            'parent_item_colon' => __( 'Parent ' . $options->get_singular_name() . ':' ),
            'search_items'      => __( 'Search ' . $options->get_plural_name() ),
            'singular_name'     => __( $options->get_singular_name() ),
            'update_item'       => __( 'Update ' . $options->get_singular_name() ),
        );

        // Create taxonomy arguments.
        $args = array(
            'hierarchical'      => $options->get_hierarchical(),
            'labels'            => $labels,
            'query_var'         => true,
            'rewrite'           => array( 'slug' => $options->get_slug() ),
            'show_admin_column' => true,
            'show_ui'           => true,
        );

        // Create taxonomy.
        register_taxonomy( $options->get_slug(), array( $options->get_post_type() ), $args );

    }
1168603
public function addOptions(array $options)
    {
        $existingOptions = $this->getOptions();
        $newOptions = empty($existingOptions) ? $options : array_merge((array)$existingOptions, $options);
        $this->setOptions($newOptions);
        return $this;
    }
196261
public function save(array $options = [])
    {
        $this->attributes['slug'] = str_slug($this->attributes['name']);

        return parent::save($options);
    }
871494
public function edit_custom_taxonomy() {

    if(!isset($_GET['custom_taxonomy_id']) ){
      $this->mf_redirect(null,null,array('message' => 'success'));
    }

    $custom_taxonomy = $this->get_custom_taxonomy($_GET['custom_taxonomy_id']);

    if( !$custom_taxonomy ){
      $this->mf_redirect(null,null,array('message' => 'error'));
    }
    $data = $this->fields_form();

    $post_types = array();
    if( isset($custom_taxonomy['post_types']) ){
      foreach($custom_taxonomy['post_types'] as $k => $v){
        array_push($post_types,$v);
      }
      $data['taxonomy']['post_type'] = $post_types;
    }
    // update fields
    $perm = array('core','option','label');
    foreach($custom_taxonomy as $key => $value){
      if( in_array($key,$perm) ){
        foreach($value as $id => $val){
          $data[$key][$id]['value'] = $val;
        }
      }
    }
    $this->form_custom_taxonomy($data);
  }
621842
public function set_options($name,$options){
		if (is_array($options)){
			$str="";
			foreach($options as $k => $v)
				$str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
			$options=$str;
		}
		$this->options[$name]=$options;
	}
388252
public function create($options = [])
    {
        $body = empty($options) ? $this->getDefaultIndexParams() : $options;

        self::getClient()->indices()->create(['index' => $this->getName(), 'body' => $body]);
    }
1097717
public function _init($options)
    {
		if(is_array($options)) {
			foreach($options as $opt_name => $opt_val) {
				if(property_exists($this, $opt_name)) {
					$this->$opt_name = $opt_val;
				}
			}
		}
    }
440498
public function setup(array $options)
    {
        foreach ($options as $method => $value) {
            $method = 'set' . ucfirst($method);
            if (method_exists($this, $method)) {
                $this->{$method}($value);
            }
        }
    }
710716
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->setOption($name, $value);
        }
    }
753797
public function addOptions(array $options)
    {
        if ($options) {
            foreach ($this->routes as $route) {
                $route->addOptions($options);
            }
        }
    }
375352
public function addOptions(array $options): Menu
    {
        foreach ($options as $value => $label) {
            $this->addOption($value, $label);
        }

        return $this;
    }
607899
protected function init(array $options = array())
    {
        foreach ($options as $key => $value) {
            if (property_exists($this, $key)) {
                $this->{$key} = $value;
            }
        }
    }
1195659
public function setOptions($options = [])
    {
        $this->options = $options;
        $this->debug->info(__FUNCTION__, 'setOptions: ', $this->options);

        return $this;
    }
23361
private function generate_taxonomy($Args, $taxonomy = 'category')
    {
        $Query = array_merge(array(
            'type'                     => 'post',
            'child_of'                 => 0,
            'parent'                   => '',
            'orderby'                  => 'name',
            'order'                    => 'ASC',
            'hide_empty'               => 0,
            'hierarchical'             => 1,
            'exclude'                  => '',
            'include'                  => '',
            'number'                   => '',
            'taxonomy'                 => $taxonomy,
            'pad_counts'               => false

        ), array_key_exists('query', $Args) ? $Args['query'] : array());

        $slug = array_key_exists('slug', $Args) ? $Args['slug'] : 'global';
        $Categories = $this->cached($taxonomy, $slug);
        if($Categories === false)
        {
            $Categories = array();
            $C = get_categories($Query);
            foreach($C as $Cat)
            {
                $Categories[$Cat->term_id] = $Cat->name;
            }
            $this->cache($taxonomy, $slug, $Categories);
        }
        $Args['data'] = $Categories + (array_key_exists('data', $Args) ? $Args['data'] : array());
        krsort($Args['data']);
        return $this->generate_select($Args, array_key_exists('multiple', $Args) ? $Args['multiple'] : false);
    }
1266835
function ctc_taxonomy_options() {

		$options = array();

		// Get exposed taxonomies
		$taxonomies = get_taxonomies( array(
			'public'	=> true,
			'show_ui'	=> true // weed out post_format
		), 'objects' );

		// Loop taxonomies
		foreach ( $taxonomies as $taxonomy_slug => $taxonomy_object ) {

			$taxonomy_name = $taxonomy_object->labels->name;

			// Set custom names for blog taxonomies
			if ( 'category' == $taxonomy_slug ) {
				$taxonomy_name = _x( 'Blog Categories', 'categories widget', 'church-theme-framework' );
			} elseif ( 'post_tag' == $taxonomy_slug ) {
				$taxonomy_name = _x( 'Blog Tags', 'categories widget', 'church-theme-framework' );
			}

			// Add to array
			$options[$taxonomy_slug] = $taxonomy_name;

		}

		// Return filtered
		return apply_filters( 'ctc_categories_widget_taxonomy_options', $options );

	}
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;
  }
472708
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->setOption($k, $v);
        }
    }