�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�
Warning: session_start(): Session cannot be started after headers have already been sent in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 135

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 547

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 548

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 549

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 550

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 551
* } * @phpstan-type LanguageData array{ * term_props: array{ * language: LanguagePropData, * }&array, * name: non-empty-string, * slug: non-empty-string, * locale: non-empty-string, * w3c: non-empty-string, * flag_code: non-empty-string, * term_group: int, * is_rtl: int<0, 1>, * facebook?: string, * home_url: non-empty-string, * search_url: non-empty-string, * host: non-empty-string, * flag_url: non-empty-string, * flag: non-empty-string, * custom_flag_url?: string, * custom_flag?: string, * page_on_front: int<0, max>, * page_for_posts: int<0, max>, * active: bool, * fallbacks?: array, * is_default: bool * } */ class PLL_Language extends PLL_Language_Deprecated { /** * Language name. Ex: English. * * @var string * * @phpstan-var non-empty-string */ public $name; /** * Language code used in URL. Ex: en. * * @var string * * @phpstan-var non-empty-string */ public $slug; /** * Order of the language when displayed in a list of languages. * * @var int */ public $term_group; /** * ID of the term in 'language' taxonomy. * Duplicated from `$this->term_props['language']['term_id'], * but kept to facilitate the use of it. * * @var int * * @phpstan-var int<1, max> */ public $term_id; /** * WordPress language locale. Ex: en_US. * * @var string * * @phpstan-var non-empty-string */ public $locale; /** * 1 if the language is rtl, 0 otherwise. * * @var int * * @phpstan-var int<0, 1> */ public $is_rtl; /** * W3C locale. * * @var string * * @phpstan-var non-empty-string */ public $w3c; /** * Facebook locale. * * @var string */ public $facebook = ''; /** * Home URL in this language. * * @var string * * @phpstan-var non-empty-string */ private $home_url; /** * Home URL to use in search forms. * * @var string * * @phpstan-var non-empty-string */ private $search_url; /** * Host corresponding to this language. * * @var string * * @phpstan-var non-empty-string */ public $host; /** * ID of the page on front in this language (set from pll_additional_language_data filter). * * @var int * * @phpstan-var int<0, max> */ public $page_on_front = 0; /** * ID of the page for posts in this language (set from pll_additional_language_data filter). * * @var int * * @phpstan-var int<0, max> */ public $page_for_posts = 0; /** * Code of the flag. * * @var string * * @phpstan-var non-empty-string */ public $flag_code; /** * URL of the flag. Always set to the main domain. * * @var string * * @phpstan-var non-empty-string */ public $flag_url; /** * HTML markup of the flag. * * @var string * * @phpstan-var non-empty-string */ public $flag; /** * URL of the custom flag if it exists. Always set to the main domain. * * @var string */ public $custom_flag_url = ''; /** * HTML markup of the custom flag if it exists. * * @var string */ public $custom_flag = ''; /** * Whether or not the language is active. Default `true`. * * @var bool */ public $active = true; /** * List of WordPress language locales. Ex: array( 'en_GB' ). * * @var string[] * * @phpstan-var list */ public $fallbacks = array(); /** * Whether the language is the default one. * * @var bool */ public $is_default; /** * Stores language term properties (like term IDs and counts) for each language taxonomy (`language`, * `term_language`, etc). * This stores the values of the properties `$term_id` + `$term_taxonomy_id` + `$count` (`language`), `$tl_term_id` * + `$tl_term_taxonomy_id` + `$tl_count` (`term_language`), and the `term_id` + `term_taxonomy_id` + `count` for * other language taxonomies. * * @var array[] Array keys are language term names. * * @example array( * 'language' => array( * 'term_id' => 7, * 'term_taxonomy_id' => 8, * 'count' => 11, * ), * 'term_language' => array( * 'term_id' => 11, * 'term_taxonomy_id' => 12, * 'count' => 6, * ), * 'foo_language' => array( * 'term_id' => 33, * 'term_taxonomy_id' => 34, * 'count' => 0, * ), * ) * * @phpstan-var array{ * language: LanguagePropData, * } * &array */ protected $term_props; /** * Constructor: builds a language object given the corresponding data. * * @since 1.2 * @since 3.4 Only accepts one argument. * * @param array $language_data { * Language object properties stored as an array. * * @type array[] $term_props An array of language term properties. Array keys are language taxonomy names * (`language` and `term_language` are mandatory), array values are arrays of * language term properties (`term_id`, `term_taxonomy_id`, and `count`). * @type string $name Language name. Ex: English. * @type string $slug Language code used in URL. Ex: en. * @type string $locale WordPress language locale. Ex: en_US. * @type string $w3c W3C locale. * @type string $flag_code Code of the flag. * @type int $term_group Order of the language when displayed in a list of languages. * @type int $is_rtl `1` if the language is rtl, `0` otherwise. * @type string $facebook Optional. Facebook locale. * @type string $home_url Home URL in this language. * @type string $search_url Home URL to use in search forms. * @type string $host Host corresponding to this language. * @type string $flag_url URL of the flag. * @type string $flag HTML markup of the flag. * @type string $custom_flag_url Optional. URL of the custom flag if it exists. * @type string $custom_flag Optional. HTML markup of the custom flag if it exists. * @type int $page_on_front Optional. ID of the page on front in this language. * @type int $page_for_posts Optional. ID of the page for posts in this language. * @type bool $active Whether or not the language is active. Default `true`. * @type string[] $fallbacks List of WordPress language locales. Ex: array( 'en_GB' ). * @type bool $is_default Whether or not the language is the default one. * } * * @phpstan-param LanguageData $language_data */ public function __construct( array $language_data ) { foreach ( $language_data as $prop => $value ) { $this->$prop = $value; } $this->term_id = $this->term_props['language']['term_id']; } /** * Returns a language term property value (term ID, term taxonomy ID, or count). * * @since 3.4 * * @param string $taxonomy_name Name of the taxonomy. * @param string $prop_name Name of the property: 'term_taxonomy_id', 'term_id', 'count'. * @return int * * @phpstan-param non-empty-string $taxonomy_name * @phpstan-param 'term_taxonomy_id'|'term_id'|'count' $prop_name * @phpstan-return int<0, max> */ public function get_tax_prop( $taxonomy_name, $prop_name ) { return $this->term_props[ $taxonomy_name ][ $prop_name ] ?? 0; } /** * Returns the language term props for all content types. * * @since 3.4 * * @param string $property Name of the field to return. An empty string to return them all. * @return (int[]|int)[] Array keys are taxonomy names, array values depend of `$property`. * * @phpstan-param 'term_taxonomy_id'|'term_id'|'count'|'' $property * @phpstan-return array : * positive-int * ) : * LanguagePropData * )> */ public function get_tax_props( $property = '' ) { if ( empty( $property ) ) { return $this->term_props; } $term_props = array(); foreach ( $this->term_props as $taxonomy_name => $props ) { $term_props[ $taxonomy_name ] = $props[ $property ]; } return $term_props; } /** * Returns the flag information. * * @since 2.6 * * @param string $code Flag code. * @return array { * Flag information. * * @type string $url Flag url. * @type string $src Optional, src attribute value if different of the url, for example if base64 encoded. * @type int $width Optional, flag width in pixels. * @type int $height Optional, flag height in pixels. * } * * @phpstan-return array{ * url: string, * src: string, * width?: positive-int, * height?: positive-int * } */ public static function get_flag_information( $code ) { $default_flag = array( 'url' => '', 'src' => '', ); // Polylang builtin flags. if ( ! empty( $code ) && is_readable( POLYLANG_DIR . ( $file = '/flags/' . $code . '.png' ) ) ) { $default_flag['url'] = plugins_url( $file, POLYLANG_FILE ); // If base64 encoded flags are preferred. if ( pll_get_constant( 'PLL_ENCODED_FLAGS', true ) ) { $imagesize = getimagesize( POLYLANG_DIR . $file ); if ( is_array( $imagesize ) ) { list( $default_flag['width'], $default_flag['height'] ) = $imagesize; } $file_contents = file_get_contents( POLYLANG_DIR . $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $default_flag['src'] = 'data:image/png;base64,' . base64_encode( $file_contents ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } } /** * Filters flag information: * * @since 2.4 * * @param array $flag { * Information about the flag. * * @type string $url Flag url. * @type string $src Optional, src attribute value if different of the url, for example if base64 encoded. * @type int $width Optional, flag width in pixels. * @type int $height Optional, flag height in pixels. * } * @param string $code Flag code. */ $flag = apply_filters( 'pll_flag', $default_flag, $code ); $flag['url'] = sanitize_url( $flag['url'] ); if ( empty( $flag['src'] ) || ( $flag['src'] === $default_flag['src'] && $flag['url'] !== $default_flag['url'] ) ) { $flag['src'] = esc_url( set_url_scheme( $flag['url'], 'relative' ) ); } if ( isset( $flag['width'] ) ) { $flag['width'] = absint( $flag['width'] ); } if ( isset( $flag['height'] ) ) { $flag['height'] = absint( $flag['height'] ); } return $flag; } /** * Returns HTML code for flag. * * @since 2.7 * * @param array $flag Flag properties: src, width and height. * @param string $title Optional title attribute. * @param string $alt Optional alt attribute. * @return string * * @phpstan-param array{ * src: string, * width?: int|numeric-string, * height?: int|numeric-string * } $flag */ public static function get_flag_html( $flag, $title = '', $alt = '' ) { if ( empty( $flag['src'] ) ) { return ''; } $alt_attr = empty( $alt ) ? '' : sprintf( ' alt="%s"', esc_attr( $alt ) ); $width_attr = empty( $flag['width'] ) ? '' : sprintf( ' width="%s"', (int) $flag['width'] ); $height_attr = empty( $flag['height'] ) ? '' : sprintf( ' height="%s"', (int) $flag['height'] ); $style = ''; $sizes = array_intersect_key( $flag, array_flip( array( 'width', 'height' ) ) ); if ( ! empty( $sizes ) ) { array_walk( $sizes, function ( &$value, $key ) { $value = sprintf( '%s: %dpx;', esc_attr( $key ), (int) $value ); } ); $style = sprintf( ' style="%s"', implode( ' ', $sizes ) ); } return sprintf( '', $flag['src'], $alt_attr, $width_attr, $height_attr, $style ); } /** * Returns the html of the custom flag if any, or the default flag otherwise. * * @since 2.8 * @since 3.5.3 Added the `$alt` parameter. * * @param string $alt Whether or not the alternative text should be set. Accepts 'alt' and 'no-alt'. * * @return string * * @phpstan-param 'alt'|'no-alt' $alt */ public function get_display_flag( $alt = 'alt' ) { $flag = empty( $this->custom_flag ) ? $this->flag : $this->custom_flag; if ( 'alt' === $alt ) { return $flag; } return (string) preg_replace( '/(?<=\salt=\")([^"]+)(?=\")/', '', $flag ); } /** * Returns the url of the custom flag if any, or the default flag otherwise. * * @since 2.8 * * @return string */ public function get_display_flag_url() { $flag_url = empty( $this->custom_flag_url ) ? $this->flag_url : $this->custom_flag_url; /** * Filters `flag_url` property. * * @since 3.4.4 * * @param string $flag_url Flag URL. * @param PLL_Language $language Current `PLL_language` instance. */ return apply_filters( 'pll_language_flag_url', $flag_url, $this ); } /** * Updates post and term count. * * @since 1.2 * * @return void */ public function update_count() { foreach ( $this->term_props as $taxonomy => $props ) { wp_update_term_count( $props['term_taxonomy_id'], $taxonomy ); } } /** * Returns the language locale. * Converts WP locales to W3C valid locales for display. * * @since 1.8 * * @param string $filter Either 'display' or 'raw', defaults to raw. * @return string * * @phpstan-param 'display'|'raw' $filter * @phpstan-return non-empty-string */ public function get_locale( $filter = 'raw' ) { return 'display' === $filter ? $this->w3c : $this->locale; } /** * Returns the values of this instance's properties, which can be filtered if required. * * @since 3.4 * * @param string $context Whether or not properties should be filtered. Accepts `db` or `display`. * Default to `display` which filters some properties. * * @return array Array of language object properties. * * @phpstan-return LanguageData */ public function to_array( $context = 'display' ) { $language = get_object_vars( $this ); if ( 'db' !== $context ) { $language['home_url'] = $this->get_home_url(); $language['search_url'] = $this->get_search_url(); } /** @phpstan-var LanguageData $language */ return $language; } /** * Converts current `PLL_language` into a `stdClass` object. Mostly used to allow dynamic properties. * * @since 3.4 * * @return stdClass Converted `PLL_Language` object. */ public function to_std_class() { return (object) $this->to_array(); } /** * Returns a predefined HTML flag. * * @since 3.4 * * @param string $flag_code Flag code to render. * @return string HTML code for the flag. */ public static function get_predefined_flag( $flag_code ) { $flag = self::get_flag_information( $flag_code ); return self::get_flag_html( $flag ); } /** * Returns language's home URL. Takes care to render it dynamically if no cache is allowed. * * @since 3.4 * * @return string Language home URL. */ public function get_home_url() { if ( ! pll_get_constant( 'PLL_CACHE_LANGUAGES', true ) || ! pll_get_constant( 'PLL_CACHE_HOME_URL', true ) ) { /** * Filters current `PLL_Language` instance `home_url` property. * * @since 3.4.4 * * @param string $home_url The `home_url` prop. * @param array $language Current Array of `PLL_Language` properties. */ return apply_filters( 'pll_language_home_url', $this->home_url, $this->to_array( 'db' ) ); } return $this->home_url; } /** * Returns language's search URL. Takes care to render it dynamically if no cache is allowed. * * @since 3.4 * * @return string Language search URL. */ public function get_search_url() { if ( ! pll_get_constant( 'PLL_CACHE_LANGUAGES', true ) || ! pll_get_constant( 'PLL_CACHE_HOME_URL', true ) ) { /** * Filters current `PLL_Language` instance `search_url` property. * * @since 3.4.4 * * @param string $search_url The `search_url` prop. * @param array $language Current Array of `PLL_Language` properties. */ return apply_filters( 'pll_language_search_url', $this->search_url, $this->to_array( 'db' ) ); } return $this->search_url; } /** * Returns the value of a language property. * This is handy to get a property's value without worrying about triggering a deprecation warning or anything. * * @since 3.4 * * @param string $property A property name. A composite value can be used for language term property values, in the * form of `{language_taxonomy_name}:{property_name}` (see {@see PLL_Language::get_tax_prop()} * for the possible values). Ex: `term_language:term_taxonomy_id`. * @return string|int|bool|string[] The requested property for the language, `false` if the property doesn't exist. * * @phpstan-return ( * $property is 'slug' ? non-empty-string : string|int|bool|list * ) */ public function get_prop( $property ) { // Deprecated property. if ( $this->is_deprecated_term_property( $property ) ) { return $this->get_deprecated_term_property( $property ); } if ( $this->is_deprecated_url_property( $property ) ) { return $this->get_deprecated_url_property( $property ); } // Composite property like 'term_language:term_taxonomy_id'. if ( preg_match( '/^(?.{1,32}):(?term_id|term_taxonomy_id|count)$/', $property, $matches ) ) { /** @var array{tax:non-empty-string, field:'term_id'|'term_taxonomy_id'|'count'} $matches */ return $this->get_tax_prop( $matches['tax'], $matches['field'] ); } return $this->$property ?? false; } }