WPDev.one
Core Function
View Source on Trac ↗

_split_shared_term()

_split_shared_term( mixed $term_id, mixed $term_taxonomy_id, mixed $record = true )

Creates a new term for a term_taxonomy item that currently shares its term

Parameters 3 required

Name / Type Description
(int

| object) $term_id ID of the shared term, or the shared term object.

Required
mixed

(int | object) $term_taxonomy_id ID of the term_taxonomy item to receive a new term, or the term_taxonomy object (corresponding to a row from the term_taxonomy table).

Required
bool

$record Whether to record data about the split term in the options table. The recording process has the potential to be resource-intensive, so during batch operations it can be beneficial to skip inline recording and do it just once, after the batch is processed. Only set this to `false` if you know what you are doing. Default: true.

Required

Return Value

((int)
(int | WP_Error) When the current term does not need to be split (or cannot be split on the current database schema), `$term_id` is returned. When the term is successfully split, the new term_id is returned. A WP_Error is returned for miscellaneous errors.

Function Information

Since Version
4.2.0
Source File
wp-includes/taxonomy.php
Advertisement