| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace WP_Syntex\Polylang\Options\Business; |
| 7 |
|
| 8 |
use WP_Error; |
| 9 |
use WP_Syntex\Polylang\Options\Primitive\Abstract_Boolean; |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
/** |
| 14 |
* Class defining the "Translate media" boolean option. |
| 15 |
* |
| 16 |
* @since 3.7 |
| 17 |
*/ |
| 18 |
class Media_Support extends Abstract_Boolean { |
| 19 |
/** |
| 20 |
* Returns option key. |
| 21 |
* |
| 22 |
* @since 3.7 |
| 23 |
* |
| 24 |
* @return string |
| 25 |
* |
| 26 |
* @phpstan-return 'media_support' |
| 27 |
*/ |
| 28 |
public static function key(): string { |
| 29 |
return 'media_support'; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Returns the description used in the JSON schema. |
| 34 |
* |
| 35 |
* @since 3.7 |
| 36 |
* |
| 37 |
* @return string |
| 38 |
*/ |
| 39 |
protected function get_description(): string { |
| 40 |
return sprintf( |
| 41 |
/* translators: %1$s and %2$s are "true/false" values. */ |
| 42 |
__( 'Translate media: %1$s to translate, %2$s otherwise.', 'polylang' ), |
| 43 |
'`true`', |
| 44 |
'`false`' |
| 45 |
); |
| 46 |
} |
| 47 |
} |
| 48 |
|