/var/www/leolaart.com/www/wp-content/plugins/polylang/include
NameSizeModeActions
api.php177630666editdlrm
base.php59320666editdlrm
cache.php25030666editdlrm
class-polylang.php87590666editdlrm
cookie.php34330666editdlrm
crud-posts.php155110666editdlrm
crud-terms.php101050666editdlrm
db-tools.php10380666editdlrm
filter-rest-routes.php49880666editdlrm
filters-links.php56860666editdlrm
filters-sanitization.php33110666editdlrm
filters-widgets-options.php26340666editdlrm
filters.php157520666editdlrm
functions.php71730666editdlrm
language-deprecated.php73550666editdlrm
language-factory.php95350666editdlrm
language.php184700666editdlrm
license.php94150666editdlrm
links-abstract-domain.php32400666editdlrm
links-default.php31000666editdlrm
links-directory.php97210666editdlrm
links-domain.php31360666editdlrm
links-model.php66390666editdlrm
links-permalinks.php57530666editdlrm
links-subdomain.php22160666editdlrm
links.php13310666editdlrm
mo.php20200666editdlrm
model.php346510666editdlrm
nav-menu.php45330666editdlrm
olt-manager.php85670666editdlrm
query.php65440666editdlrm
rest-request.php31940666editdlrm
static-pages.php64150666editdlrm
switcher.php111510666editdlrm
translatable-object-with-types-interface.php11270666editdlrm
translatable-object-with-types-trait.php19360666editdlrm
translatable-object.php135930666editdlrm
translatable-objects.php35690666editdlrm
translate-option.php127590666editdlrm
translated-object.php167860666editdlrm
translated-post.php119640666editdlrm
translated-term.php100080666editdlrm
walker-dropdown.php35380666editdlrm
walker-list.php23080666editdlrm
walker.php23360666editdlrm
widget-calendar.php96670666editdlrm
widget-languages.php46780666editdlrm
Edit: /var/www/leolaart.com/www/wp-content/plugins/polylang/include/translatable-objects.php (3569B)
* @phpstan-type TranslatedObjectWithTypes PLL_Translated_Object&PLL_Translatable_Object_With_Types_Interface * @phpstan-type TranslatableObjectWithTypes PLL_Translatable_Object&PLL_Translatable_Object_With_Types_Interface */ class PLL_Translatable_Objects implements IteratorAggregate { /** * Type of the main translatable object. * * @var string */ private $main_type = ''; /** * List of registered objects. * * @var PLL_Translatable_Object[] Array keys are the type of translated content (post, term, etc). * * @phpstan-var array */ private $objects = array(); /** * Registers a translatable object. * * @since 3.4 * * @param PLL_Translatable_Object $object The translatable object to register. * @return PLL_Translatable_Object */ public function register( PLL_Translatable_Object $object ) { if ( empty( $this->main_type ) ) { $this->main_type = $object->get_type(); } if ( ! isset( $this->objects[ $object->get_type() ] ) ) { $this->objects[ $object->get_type() ] = $object; } return $this->objects[ $object->get_type() ]; } /** * Returns all registered translatable objects. * * @since 3.4 * * @return ArrayIterator Iterator on $objects array property. Keys are the type of translated content (post, term, etc). * * @phpstan-return ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator( $this->objects ); } /** * Returns a translatable object, given an object type. * * @since 3.4 * * @param string $object_type The object type. * @return PLL_Translatable_Object|null * * @phpstan-return ( * $object_type is 'post' ? TranslatedObjectWithTypes : ( * $object_type is 'term' ? TranslatedObjectWithTypes : ( * TranslatedObjectWithTypes|TranslatableObjectWithTypes|PLL_Translated_Object|PLL_Translatable_Object|null * ) * ) * ) */ public function get( $object_type ) { if ( ! isset( $this->objects[ $object_type ] ) ) { return null; } return $this->objects[ $object_type ]; } /** * Returns all translatable objects except post one. * * @since 3.4 * * @return PLL_Translatable_Object[] An array of secondary translatable objects. Array keys are the type of translated content (post, term, etc). * * @phpstan-return array */ public function get_secondary_translatable_objects() { return array_diff_key( $this->objects, array( $this->main_type => null ) ); } /** * Returns taxonomy names to manage language and translations. * * @since 3.4 * * @param string[] $filter An array on value to filter taxonomy names to return. * @return string[] Taxonomy names. * * @phpstan-param array<'language'|'translations'> $filter * @phpstan-return list */ public function get_taxonomy_names( $filter = array( 'language', 'translations' ) ) { $taxonomies = array(); foreach ( $this->objects as $object ) { if ( in_array( 'language', $filter, true ) ) { $taxonomies[] = $object->get_tax_language(); } if ( in_array( 'translations', $filter, true ) && $object instanceof PLL_Translated_Object ) { $taxonomies[] = $object->get_tax_translations(); } } return $taxonomies; } }