�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
0x0x
PHP 8.2.31
Preview: links.php Size: 13.04 KB
/home/mciraet/www/wp-content/plugins/polylang-wc/src/links.php
<?php
/**
 * @package Polylang-WC
 */

/**
 * Translates links.
 *
 * @since 0.1
 */
class PLLWC_Links {

	/**
	 * Constructor.
	 *
	 * @since 0.1
	 */
	public function __construct() {
		// Rewrite rules.
		add_action( 'pll_prepare_rewrite_rules', array( $this, 'prepare_rewrite_rules' ), 5 ); // Before Polylang.
		add_filter( 'pll_modify_rewrite_rule', array( $this, 'fix_rewrite_rules' ), 10, 4 );

		// Translation of the current url.
		add_filter( 'pll_translation_url', array( $this, 'pll_translation_url' ), 10, 2 );

		// Breadcrumb.
		add_filter( 'woocommerce_breadcrumb_home_url', 'pll_home_url', 10, 0 );

		if ( PLL() instanceof PLL_Frontend ) {
			add_filter( 'option_woocommerce_permalinks', array( $this, 'option_woocommerce_permalinks' ) );
		}

		add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'checkout_order_received_url' ), 10, 2 );

		if ( PLL()->options['force_lang'] > 1 ) {
			add_filter( 'woocommerce_customer_available_downloads', array( $this, 'filter_download_urls' ) );
			add_filter( 'woocommerce_get_item_downloads', array( $this, 'filter_download_urls' ) );
			add_filter( 'woocommerce_product_file_download_path', array( $this, 'filter_download_url' ) );
		}
	}

	/**
	 * Prepares rewrite rules filters for the shop.
	 *
	 * @since 0.1
	 * @since 1.9 Hooked to `pll_prepare_rewrite_rules` and set default value to `$pre` parameter.
	 * @since 2.2 Removed param and return value, the method being hooked to an action instead of a filter.
	 *
	 * @return void
	 */
	public function prepare_rewrite_rules() {
		if ( ! has_filter( 'rewrite_rules_array', array( $this, 'rewrite_shop_rules' ) ) ) {
			add_filter( 'rewrite_rules_array', array( $this, 'rewrite_shop_rules' ), 5 ); // Before Polylang.
			add_filter( 'rewrite_rules_array', array( $this, 'rewrite_shop_subpages_rules' ), 20 ); // After wc_fix_rewrite_rules().
		}
	}

	/**
	 * Get the shop pages slugs in all languages.
	 *
	 * @since 0.3.6
	 *
	 * @return string[]
	 */
	protected function get_all_shop_page_slugs() {
		$slugs = array();
		$id    = wc_get_page_id( 'shop' );
		$ids   = pll_get_post_translations( $id );

		_prime_post_caches( $ids ); // Prime posts cache before `get_page_uri()` calls in the loop.

		foreach ( $ids as $lang => $id ) {
			$slugs[ $lang ] = urldecode( (string) get_page_uri( $id ) );
		}

		return array_filter( $slugs );
	}

	/**
	 * Modifies the product archive rewrite rules
	 * to get the slugs directly from all the shop page translations.
	 * It must be done after WooCommerce for the shop rules to stay on top.
	 * Hooked to the filter 'rewrite_rules_array'.
	 *
	 * @since 0.1
	 *
	 * @param string[] $rules Rewrite rules.
	 * @return string[] Modified rewrite rules.
	 */
	public function rewrite_shop_rules( $rules ) {
		$new_rules = array();
		$id = wc_get_page_id( 'shop' );

		if ( $id ) {
			$uri = urldecode( (string) get_page_uri( $id ) ) . '/'; // The page uri got from the WooCommerce option.
			$translations = $this->get_all_shop_page_slugs();

			if ( count( $translations ) > 1 ) {
				if ( PLL()->options['force_lang'] > 0 ) {
					// The language is set from the directory, subdomain or domain.
					$translations = array_unique( $translations );
					$new_uri = '(' . implode( '|', $translations ) . ')/';

					foreach ( $rules as $key => $rule ) {
						if ( 0 === strpos( $key, $uri ) ) { // OK if we are acting before Polylang.
							$new_rules[ str_replace( $uri, $new_uri, $key ) ] = str_replace(
								array( '[8]', '[7]', '[6]', '[5]', '[4]', '[3]', '[2]', '[1]' ),
								array( '[9]', '[8]', '[7]', '[6]', '[5]', '[4]', '[3]', '[2]' ),
								$rule
							); // Hopefully it is sufficient!

							unset( $rules[ $key ] ); // Now useless.
						}
					}
				} else {
					/*
					 * When the language is set from the content, we need to explicitly set one rewrite rule per language
					 * and make sure to avoid a conflict with the product rewrite rules when the shop base matches the shop page slug.
					 */
					foreach ( $rules as $key => $rule ) {
						if ( 0 === strpos( $key, $uri ) && false !== strpos( $rule, 'post_type=product' ) ) {
							foreach ( $translations as $lang => $new_uri ) {
								$new_rules[ str_replace( $uri, $new_uri . '/', $key ) ] = str_replace( '?', "?lang=$lang&", $rule );
							}

							unset( $rules[ $key ] ); // Now useless.
						}
					}
				}
			}
		}

		return $new_rules + $rules;
	}

	/**
	 * Add rewrite rules for the shop subpages.
	 * It must be done after WooCommerce to remove the rules created by WooCommerce.
	 *
	 * @since 0.9.5
	 *
	 * @param string[] $rules Rewrite rules.
	 * @return string[] Modified rewrite rules.
	 */
	public function rewrite_shop_subpages_rules( $rules ) {
		global $wp_rewrite;

		$permalinks = wc_get_permalink_structure();
		$page_rewrite_rules = array();

		if ( $permalinks['use_verbose_page_rules'] && $id = wc_get_page_id( 'shop' ) ) {
			foreach ( pll_get_post_translations( $id ) as $lang => $shop_page_id ) {
				$subpages = wc_get_page_children( $shop_page_id );

				foreach ( $subpages as $subpage ) {
					$uri = urldecode( (string) get_page_uri( $subpage ) );

					// Remove rules added by WooCommerce as it is easier to add our own rather than modifying them separately.
					foreach ( $rules as $key => $rule ) {
						if ( false !== strpos( $rule, 'pagename=' . $uri ) ) {
							unset( $rules[ $key ] );
						}
					}

					if ( PLL()->options['hide_default'] && PLL()->options['default_lang'] === $lang ) {
						$slug = $uri;
					} else {
						$slug = $lang . '/' . $uri;
					}

					/*
					 * Inspired by WooCommerce wc_fix_rewrite_rules().
					 * Code last checked: WC 4.0
					 */
					$page_rewrite_rules[ $slug . '/?$' ] = 'index.php?pagename=' . $uri;
					$wp_generated_rewrite_rules = $wp_rewrite->generate_rewrite_rules( $slug, EP_PAGES, true, true, false, false );
					foreach ( $wp_generated_rewrite_rules as $key => $value ) {
						$wp_generated_rewrite_rules[ $key ] = $value . '&pagename=' . $uri;
					}
					$page_rewrite_rules = array_merge( $page_rewrite_rules, $wp_generated_rewrite_rules );
				}
			}
		}
		return $page_rewrite_rules + $rules;
	}

	/**
	 * Prevents Polylang from modifying some rewrite rules.
	 *
	 * @since 0.1
	 *
	 * @param bool        $modify  Whether to modify or not the rule, defaults to true.
	 * @param string[]    $rule    Original rewrite rule.
	 * @param string      $filter  Current set of rules being modified.
	 * @param string|bool $archive Custom post post type archive name or false if it is not a cpt archive.
	 * @return bool
	 */
	public function fix_rewrite_rules( $modify, $rule, $filter, $archive ) {
		if ( 'root' === $filter && false !== strpos( reset( $rule ), 'wc-api=$matches[2]' ) ) {
			return false;
		}

		if ( ! PLL()->options['force_lang'] && 'rewrite_rules_array' === $filter && 'product' === $archive ) {
			return false;
		}

		return $modify;
	}

	/**
	 * Returns the translation of the current url.
	 * Hooked to the filter 'pll_translation_url'.
	 *
	 * @since 0.1
	 *
	 * @param string $url  Translation url.
	 * @param string $lang Language slug.
	 * @return string
	 */
	public function pll_translation_url( $url, $lang ) {
		global $wp;

		// Shop.
		if ( is_shop() && ! is_search() ) {
			$url = '';
			$tr_shop_id = pll_get_post( wc_get_page_id( 'shop' ), $lang );

			if ( $tr_shop_id ) {
				$url = get_permalink( $tr_shop_id );

				// Layered nav.
				foreach ( wc_get_attribute_taxonomies() as $tax ) {
					$name = 'filter_' . $tax->attribute_name;

					if ( ! empty( $_GET[ $name ] ) && $tr_id = pll_get_term( (int) $_GET[ $name ], $lang ) ) { // phpcs:ignore WordPress.Security.NonceVerification
						$url = add_query_arg( array( $name => $tr_id ), $url );
					}
				}
			}
		}

		// Endpoints.
		if ( $endpoint = WC()->query->get_current_endpoint() ) {
			$value = wc_edit_address_i18n( $wp->query_vars[ $endpoint ], true ); // Address.
			$url = wc_get_endpoint_url( $endpoint, $value, $url );
			if ( PLL()->links_model->using_permalinks ) {
				$url = trailingslashit( $url ); // Needed for address.
			}

			if ( 'order-received' === $endpoint ) {
				$order = wc_get_order( $value );
				if ( $order instanceof WC_Order ) {
					$url = add_query_arg( 'key', $order->get_order_key(), $url );
				}
			}

			if ( 'order-pay' === $endpoint ) {
				$order = wc_get_order( $value );
				if ( $order instanceof WC_Order ) {
					$url = add_query_arg(
						array(
							'pay_for_order' => 'true',
							'key'           => $order->get_order_key(),
						),
						$url
					);
				}
			}
		}

		return $url;
	}

	/**
	 * Fixes the "Shop" link in the breadcrumb.
	 * Note that WooCommerce uses the presence of the shop page slug in permalink product base to display it.
	 * Hooked to the filter 'option_woocommerce_permalinks'.
	 *
	 * @since 0.3.6
	 *
	 * @param string[] $permalinks WooCommerce permalinks options.
	 * @return string[]
	 */
	public function option_woocommerce_permalinks( $permalinks ) {
		if ( isset( $permalinks['product_base'] ) && did_action( 'pll_language_defined' ) ) {
			$slugs = $this->get_all_shop_page_slugs();
			$lang  = pll_current_language();

			if ( count( $slugs ) > 1 && ! empty( $slugs[ $lang ] ) ) {
				$pattern = '#(' . implode( '|', $slugs ) . ')#';
				$permalinks['product_base'] = (string) preg_replace( $pattern, $slugs[ $lang ], $permalinks['product_base'] );
			}
		}

		return $permalinks;
	}

	/**
	 * Sets `home_url` property when using plain permalinks and the shop is on front.
	 *
	 * @since 1.8
	 *
	 * @param array $additional_data    Array of editable language properties.
	 * @param array $data Language data Array of `PLL_Language` object properties currently created.
	 * @return array Editable properties with `home_url` set.
	 *
	 * @phpstan-param array<non-empty-string, mixed> $additional_data
	 * @phpstan-param non-empty-array<non-empty-string, mixed> $data
	 */
	public static function set_home_url( $additional_data, $data ) {
		if (
			! function_exists( 'wc_get_page_id' ) // Test that wc_get_page_id() exists as the filter is applied before we check if WooCommerce is activated.
			|| get_option( 'permalink_structure' ) // Plain permalink sets `permalink_structure` option to empty string.
			|| 'page' !== get_option( 'show_on_front' )
			) {

			return $additional_data;
		}

		// Use `PLL_Translated_Post::get_raw_translation()` instead of `PLL_Translated_Post::get_translations()` to avoid calling `PLL_Model::get_languages_list()` while languages are created.
		$shop_page_translations = PLL()->model->post->get_raw_translations( wc_get_page_id( 'shop' ) );

		if ( isset( $additional_data['page_on_front'] ) && ! in_array( $additional_data['page_on_front'], $shop_page_translations, true ) ) {
			return $additional_data;
		}

		if ( PLL()->options['hide_default'] && PLL()->options['default_lang'] === $data['slug'] ) {
			return $additional_data;
		}

		$additional_data['home_url'] = home_url( '/?post_type=product&lang=' . $data['slug'] );

		return $additional_data;
	}

	/**
	 * Makes sure that the order received url is in the same language as the order.
	 * This is especially useful when evaluating the return url for gateways, which
	 * evaluate the return url on an api endpoint.
	 *
	 * @since 1.5.1
	 *
	 * @param string   $url   Order received url.
	 * @param WC_Order $order WC_Order object.
	 * @return string
	 */
	public function checkout_order_received_url( $url, $order ) {
		static $avoid_recursion = false;

		if ( $avoid_recursion ) {
			return $url;
		}

		/** @var PLLWC_Order_Language_CPT */
		$data_store = PLLWC_Data_Store::load( 'order_language' );
		$lang = $data_store->get_language( $order->get_id() );

		if ( $lang ) {
			$avoid_recursion = true;
			$saved_curlang = PLL()->curlang;

			PLL()->curlang = PLL()->model->get_language( $lang );

			add_filter( 'option_woocommerce_checkout_page_id', 'pll_get_post' ); // Translate checkout redirect URL.
			$url = $order->get_checkout_order_received_url();

			$avoid_recursion = false;
			PLL()->curlang = $saved_curlang;
		}
		return $url;
	}

	/**
	 * Filters downloads URL to switch them to the current language.
	 *
	 * @since 2.2
	 *
	 * @param array $downloads List of downloads.
	 * @return array List of downloads updated with their URL corresponding to the current language.
	 */
	public function filter_download_urls( $downloads ) {
		if ( ! is_array( $downloads ) || ! PLL()->curlang instanceof PLL_Language ) {
			return $downloads;
		}

		foreach ( $downloads as $key => $download ) {
			if ( empty( $download['download_url'] ) ) {
				continue;
			}

			$downloads[ $key ]['download_url'] = PLL()->links_model->switch_language_in_link( $download['download_url'], PLL()->curlang );
		}

		return $downloads;
	}

	/**
	 * Filters one download URL to switch it to the current language.
	 * This prevents to trigger a "File not found" error when trying to download a file.
	 *
	 * @since 2.2
	 *
	 * @see WC_Download_Handler::download_product()
	 *
	 * @param string $download_url File download URL.
	 * @return string
	 */
	public function filter_download_url( $download_url ) {
		if ( empty( $download_url ) || ! PLL()->curlang instanceof PLL_Language ) {
			return $download_url;
		}

		return PLL()->links_model->switch_language_in_link( $download_url, PLL()->curlang );
	}
}

Directory Contents

Dirs: 6 × Files: 26
Name Size Perms Modified Actions
admin DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
Cart DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
frontend DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
legacy DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
modules DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
plugins DIR
- drwxr-xr-x 2026-08-16 07:29:59
Edit Download
1.38 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
1.97 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
1.60 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
16.93 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
1.54 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
710 B lrw-r--r-- 2026-06-02 10:19:43
Edit Download
2.09 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
4.11 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
8.68 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
3.01 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
6.83 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
13.04 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
4.32 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
2.62 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
3.69 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
557 B lrw-r--r-- 2026-06-02 10:19:43
Edit Download
20.25 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
25.59 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
2.73 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
7.32 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
20.92 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
6.22 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
2.36 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
6.71 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
1.53 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
3.44 KB lrw-r--r-- 2026-06-02 10:19:43
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI