| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace WP_Syntex\Polylang\Options\Business; |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
/** |
| 11 |
* Class defining taxonomies list option. |
| 12 |
* |
| 13 |
* @since 3.7 |
| 14 |
*/ |
| 15 |
class Taxonomies extends Abstract_Object_Types { |
| 16 |
/** |
| 17 |
* Returns option key. |
| 18 |
* |
| 19 |
* @since 3.7 |
| 20 |
* |
| 21 |
* @return string |
| 22 |
* |
| 23 |
* @phpstan-return 'taxonomies' |
| 24 |
*/ |
| 25 |
public static function key(): string { |
| 26 |
return 'taxonomies'; |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns non-core taxonomies. |
| 31 |
* |
| 32 |
* @since 3.7 |
| 33 |
* |
| 34 |
* @return string[] Object type names list. |
| 35 |
* |
| 36 |
* @phpstan-return array<non-falsy-string> |
| 37 |
*/ |
| 38 |
protected function get_object_types(): array { |
| 39 |
$public_taxonomies = get_taxonomies( array( '_builtin' => false ) ); |
| 40 |
/** @phpstan-var array<non-falsy-string> */ |
| 41 |
return array_diff( $public_taxonomies, get_taxonomies( array( '_pll' => true ) ) ); |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Returns the description used in the JSON schema. |
| 46 |
* |
| 47 |
* @since 3.7 |
| 48 |
* |
| 49 |
* @return string |
| 50 |
*/ |
| 51 |
protected function get_description(): string { |
| 52 |
return __( 'List of taxonomies to translate.', 'polylang' ); |
| 53 |
} |
| 54 |
} |
| 55 |
|