# logtivity/1.12.0/Logs/Core/Logtivity_Term.php

Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity, version 1.12.0. 25 lines.

- Page: https://pluginprobe.com/plugins/logtivity/1.12.0/code/Logs/Core/Logtivity_Term.php
- Raw: https://pluginprobe.com/plugins/logtivity/1.12.0/raw/Logs/Core/Logtivity_Term.php
- Modified: 2022-03-24T08:53:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/logtivity/1.12.0/code/Logs/Core/Logtivity_Term.php#L10-L20`.

```php
<?php

class Logtivity_Term
{
	public function __construct()
	{
		add_action( 'edited_terms', [$this, 'termUpdated'], 10, 2 );
	}

	public function termUpdated($term_id, $taxonomy)
	{
		$term = get_term_by('id', $term_id, $taxonomy);

		return Logtivity_Logger::log()
			->setAction('Term Updated')
			->setContext($term->name) 
			->addMeta('Term ID', $term->term_id)
			->addMeta('Slug', $term->slug)
			->addMeta('Taxonomy', $term->taxonomy)
			->addMeta('Edit Link', get_edit_term_link($term))
			->send();
	}
}

$Logtivity_Term = new Logtivity_Term;
```
