| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* A class to advertize the Share slugs module. |
| 8 |
* |
| 9 |
* @since 1.9 |
| 10 |
* @since 3.1 Renamed from PLL_Settings_Share_Slug. |
| 11 |
*/ |
| 12 |
class PLL_Settings_Preview_Share_Slug extends PLL_Settings_Module { |
| 13 |
/** |
| 14 |
* Stores the display order priority. |
| 15 |
* |
| 16 |
* @var int |
| 17 |
*/ |
| 18 |
public $priority = 70; |
| 19 |
|
| 20 |
/** |
| 21 |
* Constructor. |
| 22 |
* |
| 23 |
* @since 1.9 |
| 24 |
* |
| 25 |
* @param PLL_Settings $polylang Polylang object. |
| 26 |
* @param array $args Optional. Addition arguments. |
| 27 |
* |
| 28 |
* @phpstan-param array{ |
| 29 |
* module?: non-falsy-string, |
| 30 |
* title?: string, |
| 31 |
* description?: string, |
| 32 |
* active_option?: non-falsy-string |
| 33 |
* } $args |
| 34 |
*/ |
| 35 |
public function __construct( &$polylang, array $args = array() ) { |
| 36 |
$default = array( |
| 37 |
'module' => 'share-slugs', |
| 38 |
'title' => __( 'Share slugs', 'polylang' ), |
| 39 |
'description' => $this->get_description(), |
| 40 |
'active_option' => 'preview', |
| 41 |
); |
| 42 |
|
| 43 |
parent::__construct( $polylang, array_merge( $default, $args ) ); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns the module description. |
| 48 |
* |
| 49 |
* @since 3.1 |
| 50 |
* |
| 51 |
* @return string |
| 52 |
*/ |
| 53 |
protected function get_description() { |
| 54 |
return __( 'Allows to share the same URL slug across languages for posts and terms.', 'polylang' ); |
| 55 |
} |
| 56 |
} |
| 57 |
|