Renames a taxonomy.

Run this function before the `init` hook.

@since 2.2.0

@param string $taxonomy      The taxonomy to rename.
@param string $name_singular The new singular name.
@param string $name_plural   The new plural name.
351371
public static function rename( $taxonomy, $name_singular, $name_plural ) {
		if ( ! taxonomy_exists( $taxonomy ) ) {
			return;
		}

		( new Taxonomy_Labels( $taxonomy, $name_singular, $name_plural ) )->init();
	}
322421
public function removeTag($name)
    {
        foreach ($this->tags as $i => $tag) {
            if (strtolower($tag->getName()) == $name) {
                unset($this->tags[$i]);
            }
        }
    }
1330901
public function rename(
        UUID $uuid,
        StringLiteral $name
    ) {
        $this->apply(new RoleRenamed($uuid, $name));
    }
1145082
public static function rename($table, $new_name)
	{
		$table = new Table($table);

		// To indicate that the table needs to be renamed, we will run the
		// "rename" command on the table instance and pass the instance to
		// the execute method as calling a Closure isn't needed.
		$table->rename($new_name);

		return static::execute($table);
	}
89421
private static function register_extensions( $taxonomy, $args ) {
		if ( isset( $args['name_singular'] ) ) {
			( new Taxonomy_Labels( $taxonomy, $args['name_singular'], $args['name_plural'] ) )->init();
		}
	}
352960
@Override
	public void rename(String oldname, String newname) throws NamingException
    {
        rename(new CompositeName(oldname), new CompositeName(newname));
    }
1025072
final public function registerTaxonomy(string $taxonomy): void {
		
		// this method is public since it's likely that the Activator of a
		// plugin will want to register taxonomies and then flush the rewrite
		// rules to update permalinks.
		
		$args = $this->getTaxonomyArgs($taxonomy);
		$args["labels"] = $this->getTaxonomyLabels($taxonomy);
		$args["rewrite"] = $this->getTaxonomyRewrite($taxonomy);
		
		register_taxonomy($taxonomy, $this->getTaxonomyTypes($taxonomy), $args);
	}
181781
public function setName($name)
    {
        $this->name = $name;

        if ($this->id === null) {
            $this->id = $name;
        }
    }
424780
protected function setName($name)
    {
        if (false === is_string($name)) {
            $type = gettype($name);
            throw new ValidationException("Term 'name' must be of type string. Type $type received.");
        }

        $this->name = $name;
    }
37602
public function retag($tagNames)
    {
        $tagNames = static::$taggingUtility->makeTagArray($tagNames);
        $currentTagNames = $this->tagNames();

        $deletions = array_diff($currentTagNames, $tagNames);
        $additions = array_diff($tagNames, $currentTagNames);

        $this->untag($deletions);

        foreach($additions as $tagName) {
            $this->addTag($tagName);
        }
    }
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 );

    }
223449
public function renameTable($name, $newName)
    {
        $tableDiff          = new TableDiff($name);
        $tableDiff->newName = $newName;
        $this->alterTable($tableDiff);
    }
810453
public function delete($name)
    {
        $name = $this->parseName($name);
        ObjectArrayHelper::remove($this->data, $name);
        $this->isChanged = true;
    }
332210
public function setString($context, $text, $plural = '')
    {
        $this->context = (string) $context;
        $this->text = (string) $text;
        $this->plural = (string) $plural;
        $this->hash = md5($this->plural ? $this->context . "\004" . $this->text . "\005" . $this->plural : $this->context . "\004" . $this->text);
    }
410075
public function rename(string $name) {
        global $DB, $USER;

        $this->model->name = $name;
        $this->model->timemodified = time();
        $this->model->usermodified = $USER->id;

        $DB->update_record('analytics_models', $this->model);
    }
1174143
public function rename($collection, $name)
    {
        $collectionId = $this->getCollectionId($collection);

        if ($this->isValidCollectionId($collectionId)) {
            throw new ClientException('Cannot alter a collection without a collection id');
        }

        $params = [Collection::ENTRY_NAME => $name];
        $this->getConnection()->put(
            UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collectionId, self::OPTION_RENAME]),
            $this->json_encode_wrapper($params)
        );

        return true;
    }
74821
public function defaultLabels($plural, $singular, $hierarchical = true)
    {
        $labels = [
            'name' => $plural,
            'singular_name' => $singular,
            'menu_name' => $plural,
            'all_items' => $plural,

            'search_items' => Translate::t('term.labels.search_items'),
            'edit_item' => Translate::t('term.labels.edit_item'),
            'update_item' => Translate::t('term.labels.update_item'),
            'add_new_item' => Translate::t('term.labels.add_new_item'),
            'new_item_name' => Translate::t('term.labels.new_item_name'),
        ];

        if ($hierarchical) {
            $labels = array_merge($labels, [
                'parent_item' => Translate::t('term.labels.parent_item'),
                'parent_item_colon' => Translate::t('term.labels.parent_item_colon'),
            ]);
        } else {
            $labels = array_merge($labels, [
                'parent_item' => null,
                'parent_item_colon' => null,

                'popular_items' => Translate::t('term.labels.popular_items'),
                'separate_items_with_commas' => Translate::t('term.labels.separate_items_with_commas'),
                'choose_from_most_used' => Translate::t('term.labels.choose_from_most_used'),

                'add_or_remove_items' => Translate::t('term.labels.add_or_remove_items'),
                'not_found' => Translate::t('term.labels.not_found'),
            ]);
        }

        return $labels;
    }