| 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 post types list option. |
| 12 |
* |
| 13 |
* @since 3.7 |
| 14 |
*/ |
| 15 |
class Language_Taxonomies extends Abstract_Object_Types { |
| 16 |
/** |
| 17 |
* Returns option key. |
| 18 |
* |
| 19 |
* @since 3.7 |
| 20 |
* |
| 21 |
* @return string |
| 22 |
* |
| 23 |
* @phpstan-return 'language_taxonomies' |
| 24 |
*/ |
| 25 |
public static function key(): string { |
| 26 |
return 'language_taxonomies'; |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns language taxonomies, except the ones for posts and 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 |
/** @phpstan-var array<non-falsy-string> */ |
| 40 |
return array_diff( |
| 41 |
PLL()->model->translatable_objects->get_taxonomy_names( array( 'language' ) ), |
| 42 |
// Exclude the post and term language taxonomies from the list. |
| 43 |
array( PLL()->model->post->get_tax_language(), PLL()->model->term->get_tax_language() ) |
| 44 |
); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns the description used in the JSON schema. |
| 49 |
* |
| 50 |
* @since 3.7 |
| 51 |
* |
| 52 |
* @return string |
| 53 |
*/ |
| 54 |
protected function get_description(): string { |
| 55 |
return __( 'List of language taxonomies used for custom DB tables.', 'polylang' ); |
| 56 |
} |
| 57 |
} |
| 58 |
|