Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was experiencing an issue with the Image Gallery widget filter in PowerPack Pro for Elementor not functioning correctly after following previous troubleshooting steps. They needed a solution that would persist through updates without modifying core plugin files.
Solution:
1. We recommended backing up the site.
2. Open the file

.../wp-content/plugins/powerpack-elements/modules/gallery/widgets/image-gallery.php

with a code editor.
3. Locate the

get_filter_ids()

method around line 4146.
4. Replace the existing code around line 4177 with the following:

$translated_id = apply_filters('wpml_object_id', $unique_id, 'attachment', false);<br />if (empty($translated_id)) {<br />    continue;<br />}<br />foreach ($labels as $key => $filter_ids) {<br />    if (in_array($unique_id, $filter_ids)) {<br />        $class_name = str_replace(' ', '-', strtolower($key));<br />        if (isset($filter_labels[$translated_id])) {<br />            $filter_labels[$translated_id] .= ' ' . $class_name;<br />        } else {<br />            $filter_labels[$translated_id] = $class_name;<br />        }<br />}

5. Save the changes and test.

We also confirmed that this fix will need reapplication after future updates to the PowerPack Pro for Elementor plugin. Our compatibility team will communicate with the plugin authors to seek a permanent fix in future versions.

If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 11 replies, has 0 voices.

Last updated by Itamar 6 days, 12 hours ago.

Assisted by: Itamar.

Author Posts
June 9, 2025 at 9:38 am

bentS-3

Background of the issue:
Hi,

We followed the instructions mentioned in the ticket '[Closed] Powerpack Pro for Elementor Image gallery widget filter issue', and we have not been able to identify the issue.

We created a page (hidden link) to test. This page is published, and the page the Image Gallery widget links to is also published (hidden link). The Danish (DA) translation has also been completed for this page, so both pages and their corresponding translated pages are available to anyone.

We made a backup, activated the TwentyTwenty-Five theme, and deactivated the plug-ins one by one. The issue persisted.

Symptoms:
The issue with the Image Gallery widget filter persists despite following previous instructions and troubleshooting steps.

Questions:
We would like clarification on what this means and where to find that setting: "If the option to show the products from the default language is enabled".

Any other suggestions?

Thank you and sorry for the inconvenience on opening a new ticket.

June 9, 2025 at 10:50 am
June 9, 2025 at 11:05 am #17118115

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

As I mentioned in the chat, we need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our compatibility team. To achieve this, I created a test website with a clean WordPress installation. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

Could you please install the PowerPack Pro for Elementor plugin (which we don't have) and see if the issue is replicable on a clean WordPress installation?

I already configured WPML to have English as the default language and Danish as the second language.

Please also make sure that you are installing the latest version of the plugin.

When everything is finished and you can replicate the problem, please let us know.

Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.

Thanks,
Itamar.

June 14, 2025 at 12:11 pm #17135344

bentS-3

Hi Itamar. We were not notified that you had written a comment. I'll follow the steps you provided and get back to you on Monday.

June 15, 2025 at 10:16 am #17136076

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Sure, I'll be waiting to hear from you about it.

You are not registered to get notifications for replies in this ticket. You can change it here. Please see the attached screenshot.

Regards,
Itamar.

2025-06-15_13-13-43.jpg
June 16, 2025 at 10:19 am #17138043

bentS-3

Hi. We’ve completed the setup and were able to replicate the issue on the clean WordPress installation. However, the link to the product page on the translation is not working, even though we added the 'PP - Custom Link' on the DA Media Library.

hidden link

June 16, 2025 at 7:05 pm #17140206

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Thanks for replicating this problem on the sandbox site. I'll check it and esclate to our compatibility team. We will keep you updated on any news here.

Regards,
Itamar.

June 18, 2025 at 9:49 am #17145451

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

The issue has been escalated to our compatibility team.
We'll keep you updated here on any news regarding this issue.

I appreciate your patience.
Itamar.

June 23, 2025 at 5:44 pm #17162139

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our compatibility team has checked this issue and came up with the fpollowing workaround.

1. Back up your site in case something goes wrong.

2. Open this file with a code editor: .../wp-content/plugins/powerpack-elements/modules/gallery/widgets/image-gallery.php

3. Search for the get_filter_ids() method in around line 4146

4. Replace this code around line 4177 :

foreach ( $labels as $key => $filter_ids ) {
					if ( in_array( $unique_id, $filter_ids ) ) {
						if ( isset( $filter_labels[ $unique_id ] ) ) {
							$filter_labels[ $unique_id ] = $filter_labels[ $unique_id ] . ' ' . str_replace( ' ', '-', strtolower( $key ) );
						} else {
							$filter_labels[ $unique_id ] = str_replace( ' ', '-', strtolower( $key ) );

With this code:

$translated_id = apply_filters( 'wpml_object_id', $unique_id, 'attachment', false );

			if ( empty( $translated_id ) ) {
				continue;
			}

			foreach ( $labels as $key => $filter_ids ) {
				if ( in_array( $unique_id, $filter_ids ) ) {
					$class_name = str_replace( ' ', '-', strtolower( $key ) );

					if ( isset( $filter_labels[ $translated_id ] ) ) {
						$filter_labels[ $translated_id ] .= ' ' . $class_name;
					} else {
						$filter_labels[ $translated_id ] = $class_name;

5. Save the changes.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

We tested it on a sandbox site, and it functions as expected. You can see our test here: hidden link. We also confirmed it on a copy of your site. Please try it on your site and let us know how it works.

Regards,
Itamar.

June 30, 2025 at 11:12 am #17183496

bentS-3

Thank you, Itamar. We will test it as soon as possible and get back to you.

June 30, 2025 at 1:36 pm #17184719

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Sure, I'll wait for your reply.

June 30, 2025 at 6:44 pm #17185763

bentS-3

Hi Itamar. Thanks. This resolved the issue completely. Much appreciated.

Just to confirm: since this is a direct modification to the plugin's core files, I assume the change will be overwritten with any future updates to this file from PowerPack. As such, we’ll need to reapply the patch after each update - or at least diff the relevant sections to check for changes?

If there's a cleaner way to hook this via functions.php or extend the widget without touching core plugin files, I would see that as a more update-safe solution. Do you have any plans to implement something along those lines in future releases?

Thanks again for the help.

June 30, 2025 at 9:49 pm #17186142

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Yes, your assumption is correct. You will need to apply this fix after future updates of the PowerPack Pro for Elementor plugin. Our compatibility team will communicate this with the authors of the PowerPack Pro for Elementor plugin, and they should permanently fix it in future versions of the plugin.

Regards,
Itamar.