@@ -9095,6 +9095,18 @@ protected function is_active_on_new_blog($new_blog_id, $prev_blog_id)
90959095 public function should_customize_menu_be_removed()
90969096 {
90979097 }
9098+ /**
9099+ * Tells whether or not Polylang or third party callbacks are hooked to `customize_register`.
9100+ *
9101+ * @since 3.4.3
9102+ *
9103+ * @global $wp_filter
9104+ *
9105+ * @return bool True if Polylang's callbacks are hooked, false otherwise.
9106+ */
9107+ protected function is_customize_register_hooked()
9108+ {
9109+ }
90989110}
90999111/**
91009112 * @package Polylang
@@ -10332,6 +10344,18 @@ public function comments_clauses($clauses, $query)
1033210344 public function get_pages($pages, $args)
1033310345 {
1033410346 }
10347+ /**
10348+ * Filters the WP_Query in get_pages() per language.
10349+ *
10350+ * @since 3.4.3
10351+ *
10352+ * @param array $query_args Array of arguments passed to WP_Query.
10353+ * @param array $parsed_args Array of get_pages() arguments.
10354+ * @return array Array of arguments passed to WP_Query with the language.
10355+ */
10356+ public function get_pages_query_args($query_args, $parsed_args)
10357+ {
10358+ }
1033510359 /**
1033610360 * Get page ids related to a get_pages() in or not in a given language.
1033710361 *
@@ -13438,7 +13462,7 @@ class PLL_Frontend_Static_Pages extends \PLL_Static_Pages
1343813462 */
1343913463 protected $options;
1344013464 /**
13441- * Constructor: setups filters and actions
13465+ * Constructor: setups filters and actions.
1344213466 *
1344313467 * @since 1.8
1344413468 *
@@ -13447,16 +13471,6 @@ class PLL_Frontend_Static_Pages extends \PLL_Static_Pages
1344713471 public function __construct(&$polylang)
1344813472 {
1344913473 }
13450- /**
13451- * Init the filters
13452- *
13453- * @since 1.8
13454- *
13455- * @return void
13456- */
13457- public function pll_language_defined()
13458- {
13459- }
1346013474 /**
1346113475 * Translates the page_id query var when the site root page is requested
1346213476 *
@@ -13551,6 +13565,39 @@ public function page_for_posts_query($lang, $query)
1355113565 protected function get_page_id($query)
1355213566 {
1355313567 }
13568+ /**
13569+ * Adds support for the theme customizer.
13570+ *
13571+ * @since 3.4.2
13572+ *
13573+ * @return void
13574+ */
13575+ public function filter_customizer()
13576+ {
13577+ }
13578+ /**
13579+ * Translates the page ID when customized.
13580+ *
13581+ * @since 3.4.2
13582+ *
13583+ * @param int|false $pre A page ID if the setting is customized, false otherwise.
13584+ * @return int|false
13585+ */
13586+ public function customize_page($pre)
13587+ {
13588+ }
13589+ /**
13590+ * Fixes the translation URL if the option 'show_on_front' is customized.
13591+ *
13592+ * @since 3.4.2
13593+ *
13594+ * @param string $url An empty string or the URL of the translation of the current page.
13595+ * @param PLL_Language $language The language of the translation.
13596+ * @return string
13597+ */
13598+ public function customize_translation_url($url, $language)
13599+ {
13600+ }
1355413601}
1355513602/**
1355613603 * @package Polylang
@@ -14472,7 +14519,7 @@ public function __construct(&$options)
1447214519 * @param array $language_data Language object properties stored as an array. See `PLL_Language::__construct()`
1447314520 * for information on accepted properties.
1447414521 *
14475- * @return PLL_Language|null A language object if given data pass sanitization, null otherwise .
14522+ * @return PLL_Language A language object if given data pass sanitization.
1447614523 *
1447714524 * @phpstan-param LanguageData $language_data
1447814525 */
@@ -14485,11 +14532,11 @@ public function get($language_data)
1448514532 * @since 3.4
1448614533 *
1448714534 * @param WP_Term[] $terms List of language terms, with the language taxonomy names as array keys.
14488- * `language` is a mandatory key, `term_language` should be too in a
14489- * fully operational environment.
14490- * @return PLL_Language
14535+ * `language` is a mandatory key for the object to be created,
14536+ * `term_language` should be too in a fully operational environment.
14537+ * @return PLL_Language|null Language object on success, `null` on failure.
1449114538 *
14492- * @phpstan-param array{language:WP_Term}&array<string, WP_Term> $terms
14539+ * @phpstan-param array{language? :WP_Term}&array<string, WP_Term> $terms
1449314540 */
1449414541 public function get_from_terms(array $terms)
1449514542 {
@@ -14516,8 +14563,8 @@ public function get_from_terms(array $terms)
1451614563 * }&array<non-empty-string, LanguagePropData>,
1451714564 * name: non-empty-string,
1451814565 * slug: non-empty-string,
14519- * locale: non-falsy -string,
14520- * w3c: non-falsy -string,
14566+ * locale: non-empty -string,
14567+ * w3c: non-empty -string,
1452114568 * flag_code: non-empty-string,
1452214569 * term_group: int,
1452314570 * is_rtl: int<0, 1>,
@@ -14575,7 +14622,7 @@ class PLL_Language extends \PLL_Language_Deprecated
1457514622 *
1457614623 * @var string
1457714624 *
14578- * @phpstan-var non-falsy -string
14625+ * @phpstan-var non-empty -string
1457914626 */
1458014627 public $locale;
1458114628 /**
@@ -14591,7 +14638,7 @@ class PLL_Language extends \PLL_Language_Deprecated
1459114638 *
1459214639 * @var string
1459314640 *
14594- * @phpstan-var non-falsy -string
14641+ * @phpstan-var non-empty -string
1459514642 */
1459614643 public $w3c;
1459714644 /**
@@ -14874,7 +14921,7 @@ public function update_count()
1487414921 * @return string
1487514922 *
1487614923 * @phpstan-param 'display'|'raw' $filter
14877- * @phpstan-return non-falsy -string
14924+ * @phpstan-return non-empty -string
1487814925 */
1487914926 public function get_locale($filter = 'raw')
1488014927 {
@@ -16230,6 +16277,13 @@ public function the_languages($links, $args = array())
1623016277 * Interface to use for objects that can have one or more types.
1623116278 *
1623216279 * @since 3.4
16280+ *
16281+ * @phpstan-type DBInfoWithType array{
16282+ * table: non-empty-string,
16283+ * id_column: non-empty-string,
16284+ * type_column: non-empty-string,
16285+ * default_alias: non-empty-string
16286+ * }
1623316287 */
1623416288interface PLL_Translatable_Object_With_Types_Interface
1623516289{
@@ -16261,20 +16315,6 @@ public function is_translated_object_type($object_type);
1626116315 * This must be used with {@see PLL_Translatable_Object_With_Types_Interface}.
1626216316 *
1626316317 * @since 3.4
16264- *
16265- * @property string[] $db {
16266- * @type string $table Name of the table.
16267- * @type string $id_column Name of the column containing the object's ID.
16268- * @type string $type_column Name of the column containing the object's type.
16269- * @type string $default_alias Default alias corresponding to the object's table.
16270- * }
16271- *
16272- * @phpstan-property array{
16273- * table: non-empty-string,
16274- * id_column: non-empty-string,
16275- * type_column: non-empty-string,
16276- * default_alias: non-empty-string
16277- * } $db
1627816318 */
1627916319trait PLL_Translatable_Object_With_Types_Trait
1628016320{
@@ -16313,6 +16353,12 @@ public function is_translated_object_type($object_type)
1631316353 * Abstract class to use for object types that support at least one language.
1631416354 *
1631516355 * @since 3.4
16356+ *
16357+ * @phpstan-type DBInfo array{
16358+ * table: non-empty-string,
16359+ * id_column: non-empty-string,
16360+ * default_alias: non-empty-string
16361+ * }
1631616362 */
1631716363abstract class PLL_Translatable_Object
1631816364{
@@ -16363,25 +16409,6 @@ abstract class PLL_Translatable_Object
1636316409 * @phpstan-var non-empty-string|null
1636416410 */
1636516411 protected $object_type = \null;
16366- /**
16367- * Contains database-related informations that can be used in some of this class methods.
16368- * These are specific to the table containing the objects.
16369- *
16370- * @var string[] {
16371- * @type string $table Name of the table.
16372- * @type string $id_column Name of the column containing the object's ID.
16373- * @type string $default_alias Default alias corresponding to the object's table.
16374- * }
16375- * @see PLL_Translatable_Object::join_clause()
16376- * @see PLL_Translatable_Object::get_objects_with_no_lang_sql()
16377- *
16378- * @phpstan-var array{
16379- * table: non-empty-string,
16380- * id_column: non-empty-string,
16381- * default_alias: non-empty-string
16382- * }
16383- */
16384- protected $db;
1638516412 /**
1638616413 * Constructor.
1638716414 *
@@ -16588,6 +16615,23 @@ protected function get_objects_with_no_lang_sql(array $language_ids, $limit, arr
1658816615 public function set_language_in_mass($ids, $lang)
1658916616 {
1659016617 }
16618+ /**
16619+ * Returns database-related informations that can be used in some of this class methods.
16620+ * These are specific to the table containing the objects.
16621+ *
16622+ * @see PLL_Translatable_Object::join_clause()
16623+ * @see PLL_Translatable_Object::get_objects_with_no_lang_sql()
16624+ *
16625+ * @since 3.4.3
16626+ *
16627+ * @return string[] {
16628+ * @type string $table Name of the table.
16629+ * @type string $id_column Name of the column containing the object's ID.
16630+ * @type string $default_alias Default alias corresponding to the object's table.
16631+ * }
16632+ * @phpstan-return DBInfo
16633+ */
16634+ protected abstract function get_db_infos();
1659116635}
1659216636/**
1659316637 * @package Polylang
@@ -17042,6 +17086,8 @@ public function set_translation_in_mass($translations)
1704217086 * Sets the posts languages and translations model up.
1704317087 *
1704417088 * @since 1.8
17089+ *
17090+ * @phpstan-import-type DBInfoWithType from PLL_Translatable_Object_With_Types_Interface
1704517091 */
1704617092class PLL_Translated_Post extends \PLL_Translated_Object implements \PLL_Translatable_Object_With_Types_Interface
1704717093{
@@ -17203,11 +17249,33 @@ public function current_user_can_read($id, $context = 'view')
1720317249 public function get_untranslated($type, \PLL_Language $untranslated_in, \PLL_Language $lang, $search = '')
1720417250 {
1720517251 }
17252+ /**
17253+ * Returns database-related informations that can be used in some of this class methods.
17254+ * These are specific to the table containing the objects.
17255+ *
17256+ * @see PLL_Translatable_Object::join_clause()
17257+ * @see PLL_Translatable_Object::get_objects_with_no_lang_sql()
17258+ *
17259+ * @since 3.4.3
17260+ *
17261+ * @return string[] {
17262+ * @type string $table Name of the table.
17263+ * @type string $id_column Name of the column containing the object's ID.
17264+ * @type string $type_column Name of the column containing the object's type.
17265+ * @type string $default_alias Default alias corresponding to the object's table.
17266+ * }
17267+ * @phpstan-return DBInfoWithType
17268+ */
17269+ protected function get_db_infos()
17270+ {
17271+ }
1720617272}
1720717273/**
1720817274 * Sets the taxonomies languages and translations model up.
1720917275 *
1721017276 * @since 1.8
17277+ *
17278+ * @phpstan-import-type DBInfoWithType from PLL_Translatable_Object_With_Types_Interface
1721117279 */
1721217280class PLL_Translated_Term extends \PLL_Translated_Object implements \PLL_Translatable_Object_With_Types_Interface
1721317281{
@@ -17384,6 +17452,26 @@ protected function should_update_translation_group($id, $translations)
1738417452 public function set_language_in_mass($ids, $lang)
1738517453 {
1738617454 }
17455+ /**
17456+ * Returns database-related informations that can be used in some of this class methods.
17457+ * These are specific to the table containing the objects.
17458+ *
17459+ * @see PLL_Translatable_Object::join_clause()
17460+ * @see PLL_Translatable_Object::get_objects_with_no_lang_sql()
17461+ *
17462+ * @since 3.4.3
17463+ *
17464+ * @return string[] {
17465+ * @type string $table Name of the table.
17466+ * @type string $id_column Name of the column containing the object's ID.
17467+ * @type string $type_column Name of the column containing the object's type.
17468+ * @type string $default_alias Default alias corresponding to the object's table.
17469+ * }
17470+ * @phpstan-return DBInfoWithType
17471+ */
17472+ protected function get_db_infos()
17473+ {
17474+ }
1738717475}
1738817476/**
1738917477 * @package Polylang
0 commit comments