# wordpress-seo/18.2/src/exceptions/indexable/invalid-term-exception.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 18.2. 27 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/18.2/code/src/exceptions/indexable/invalid-term-exception.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/18.2/raw/src/exceptions/indexable/invalid-term-exception.php
- Modified: 2021-05-18T13:42:44+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/wordpress-seo/18.2/code/src/exceptions/indexable/invalid-term-exception.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Exceptions\Indexable;

/**
 * Exception that can be thrown whenever a term is considered invalid by WordPress
 * within the context of the indexables.
 */
class Invalid_Term_Exception extends Source_Exception {

	/**
	 * Exception that can be thrown whenever a term is considered invalid by WordPress
	 * within the context of the indexables.
	 *
	 * @param string $reason The reason given by WordPress why the term is invalid.
	 */
	public function __construct( $reason ) {
		parent::__construct(
			\sprintf(
				/* translators: %s is the reason given by WordPress. */
				\esc_html__( 'The term is considered invalid. The following reason was given by WordPress: %s', 'wordpress-seo' ),
				$reason
			)
		);
	}
}

```
