get_term_to_edit()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_term_to_edit( int|object $id, string $taxonomy ): string|int|null|WP_Error
Описание
Возвращаемое значение — sanitize_term(), а назначение — очистка термина для редактирования. Функция служит для контекста и простоты.
Оригинал (английский)
Return value is sanitize_term() and usage is for sanitizing the term for editing. Function is for contextual and simplicity.
Параметры
$id
int|object
обязательный
$taxonomy
string
обязательный
Возвращаемое значение
string|int|null|WP_Error
Исходный код
wp-includes/taxonomy.php:1250
function get_term_to_edit( $id, $taxonomy ) {
$term = get_term( $id, $taxonomy );
if ( is_wp_error( $term ) ) {
return $term;
}
if ( ! is_object( $term ) ) {
return '';
}
return sanitize_term( $term, $taxonomy, 'edit' );
}
История изменений
| Версия | Описание |
|---|---|
| 2.3.0 | Introduced. |

