Skip Navigation

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

Problem:
The client was experiencing issues with the display of the WPML language switcher icon/text in the "Header" and "BuddyPanel" menus on a multilingual website using Learndash and the BuddyBoss Platform/Theme. A "no-icon" appeared on the Header menu, and a "bb-icon-file" icon appeared on the side panel.

Solution:
Please see this thread https://wpml.org/forums/topic/issue-with-wpmls-menu-language-switcher-on-buddyboss-theme/#post-15202854 for detailed solution.

If this solution doesn't look relevant to your issue, please open a new support ticket with us.

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 2 voices.

Last updated by Waqas Bin Hasan 1 year, 4 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
January 10, 2024 at 10:39 am #15168080

micheleB-25

Hello,
I must use WPML on a multilingual website with Learndash + BuddyBoss Platform/Theme.
Everything would work correctly except for placing the language switcher icon/text on the "Header" and "BuddyPanel" menus. When I activate the option on the WPML "Menu language switcher", a "no-icon" appears on the Header menu, and a "bb-icon-file" icon appears on the side panel.
Do you have any tutorials or suggestions for optimally enabling the language switcher on BuddyBoss menus?
Thanks.
Regards,
Michele

P.S. I already asked for technical support from BuddyBoss, but they told me to contact you.

buddyboss-issue-wpml-menu-language-switcher.png
January 10, 2024 at 10:58 am #15168143

micheleB-25

I've tried an identical issue reported here on the forum:
https://wpml.org/de/forums/topic/icon-sprachumschalter-im-buddypanel-menue-buddyboss/

Could someone tell me if this issue is under investigation by WPML?

January 10, 2024 at 11:53 am #15168522

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

That issue is known by our team. However, can you please confirm if the solution in other forum ticket helped you solve the problem?

Regards.

January 10, 2024 at 12:00 pm #15168548

micheleB-25

Hi,
The solution works only for the icon in the "BuddyPanel" menus; instead, in the "Header", I've always seen the missing icon "no-icon".
Thanks.
Regards,
Michele

buddyboss-issue-wpml-menu-language-switcher_002.png
January 10, 2024 at 12:57 pm #15168965

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

January 11, 2024 at 8:01 am #15172492

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access. I am working on this and 'll get back to you as soon as I find something or have a solution.

January 11, 2024 at 1:08 pm #15174606

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I am still working on this and 'll get back to you as soon as I find something or have a solution.

Thank you for your patience and cooperation.

January 12, 2024 at 6:39 am #15177268

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I've escalated the issue to our 2nd tier team, along with a copy of the test site you provided. Please keep the access to the test site open.

I'll update you as soon as I hear back.

January 18, 2024 at 9:54 am #15199005

micheleB-25

Is there any news? I need to continue the work on the website I activated for you. Thank you.

January 18, 2024 at 12:25 pm #15199664

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and apologies for the delay. Team is working on this while there's no further information available. However please note that such tasks may take some time.

But I'll get back to you as soon as I've some information - I've highlighted the matter again.

January 18, 2024 at 1:32 pm #15200085

micheleB-25

Thank you for reaching out to those in charge. However, I would like to inform you that I must delete the staging area if I do not receive a response by Monday. This is because I need to continue with my work. In any case, the issue can be easily replicated with any WPML installation on BuddyBoss. Thank you for your attention/support.

January 19, 2024 at 5:10 am #15202854

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and the heads up.

I've applied following workarounds as suggested by the team and these seem to work fine in your staging site (we've also tested in our sandbox site).

In the /wp-content/themes/buddyboss-theme/inc/theme/functions.php file of the "Parent theme":

- Replaced the "bb_buddypanel_menu_atts()" function (around line 582):

function bb_buddypanel_menu_atts( $atts, $item, $args ) {
	if (
		isset( $args->theme_location ) &&
		(
			'buddypanel-loggedin' === $args->theme_location ||
			'buddypanel-loggedout' === $args->theme_location
		)
	) {
		$atts['class'] = 'bb-menu-item';

		$header = (int) buddyboss_theme_get_option( 'buddyboss_header' );
		if ( 3 === $header ) {
			$buddypanel_side = buddyboss_theme_get_option( 'buddypanel_position_h3' );
		} else {
			$buddypanel_side = buddyboss_theme_get_option( 'buddypanel_position' );
		}

		if ( $buddypanel_side && $buddypanel_side == 'right' ) {
			$atts['data-balloon-pos'] = 'left';
		} else {
			$atts['data-balloon-pos'] = 'right';
		}
		$atts['data-balloon'] = $item->title;
	}

	return $atts;
}

- With:

function bb_buddypanel_menu_atts( $atts, $item, $args ) {
	if (
		isset( $args->theme_location ) &&
		(
			'buddypanel-loggedin' === $args->theme_location ||
			'buddypanel-loggedout' === $args->theme_location
		)
	) {
		$atts['class'] = 'bb-menu-item';

		$header = (int) buddyboss_theme_get_option( 'buddyboss_header' );
		if ( 3 === $header ) {
			$buddypanel_side = buddyboss_theme_get_option( 'buddypanel_position_h3' );
		} else {
			$buddypanel_side = buddyboss_theme_get_option( 'buddypanel_position' );
		}

		if ( $buddypanel_side && $buddypanel_side == 'right' ) {
			$atts['data-balloon-pos'] = 'left';
		} else {
			$atts['data-balloon-pos'] = 'right';
		}
		$atts['data-balloon'] = $item->title;
		// WPMl workaround for compsupp-7115
		if (class_exists('Sitepress')) {
			$atts['data-balloon'] = wp_strip_all_tags($item->title);
		}
	}

	return $atts;
}

- Then, In the "start_el()" function, around line 895, replaced the following snippet:

if ( ! $icon ) {
	if ( in_array( 'bp-menu', $item->classes ) ) {
		if ( 'bp-profile-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-user';
		} elseif ( 'bp-settings-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-cog';
		} elseif ( 'bp-activity-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-activity';
		} elseif ( 'bp-notifications-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-bell';
		} elseif ( 'bp-messages-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-inbox';
		} elseif ( 'bp-friends-nav' === $item->classes[1] || 'bp-friends-sub-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-user-friends';
		} elseif ( 'bp-groups-nav' === $item->classes[1] || 'bp-groups-sub-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-users';
		} elseif ( 'bp-forums-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-comments-square';
		} elseif ( 'bp-videos-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-video';
		} elseif ( 'bp-documents-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-folder-alt';
		} elseif ( 'bp-photos-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-image';
		} elseif ( 'bp-invites-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-envelope';
		} elseif ( 'bp-logout-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-sign-out';
		} elseif ( 'bp-login-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-sign-in';
		} elseif ( 'bp-register-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-clipboard';
		} elseif ( 'bp-courses-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-graduation-cap';
		}
	}
	if ( ! $icon ) {
		$item->title = "<i class='bb-icon-file'></i><span class='link-text'>{$item->title}</span>";
	} else {
		$item->title = "<i class='_mi _before buddyboss bb-icon-l " . $icon . "'></i><span class='link-text'>{$item->title}</span>";
	}
}

- With:

if ( ! $icon ) {
	if ( in_array( 'bp-menu', $item->classes ) ) {
		if ( 'bp-profile-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-user';
		} elseif ( 'bp-settings-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-cog';
		} elseif ( 'bp-activity-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-activity';
		} elseif ( 'bp-notifications-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-bell';
		} elseif ( 'bp-messages-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-inbox';
		} elseif ( 'bp-friends-nav' === $item->classes[1] || 'bp-friends-sub-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-user-friends';
		} elseif ( 'bp-groups-nav' === $item->classes[1] || 'bp-groups-sub-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-users';
		} elseif ( 'bp-forums-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-comments-square';
		} elseif ( 'bp-videos-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-video';
		} elseif ( 'bp-documents-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-folder-alt';
		} elseif ( 'bp-photos-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-image';
		} elseif ( 'bp-invites-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-envelope';
		} elseif ( 'bp-logout-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-sign-out';
		} elseif ( 'bp-login-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-sign-in';
		} elseif ( 'bp-register-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-clipboard';
		} elseif ( 'bp-courses-nav' === $item->classes[1] ) {
			$icon = 'bb-icon-graduation-cap';
		}
	}

	// WPML Workround for compsupp-7115
	elseif (in_array( 'wpml-ls-item', $item->classes)) {
		$icon = 'bb-icon-globe';
	}

	if ( ! $icon ) {
		$item->title = "<i class='bb-icon-file'></i><span class='link-text'>{$item->title}</span>";
	} else {
		if (! preg_match('/<img/', $item->title) ) {
			$item->title = "<i class='_mi _before buddyboss bb-icon-l " . $icon . "'></i><span class='link-text'>{$item->title}</span>";
		}
	}
}

- Then around line 1056, just before:

		if ( ! $icon ) {
			$classes[] = 'no-icon';

- Replaced with:

		// WPML Workround for compsupp-7139
		if (in_array( 'wpml-ls-item', $item->classes)) {
			$icon = 'bb-icon-globe';
		}	

And it is working fine now (see attached).

Please check and confirm, thanks.

final.jpg
January 19, 2024 at 8:43 am #15203374

micheleB-25

I confirm that the workaround received works well.
I have saved the instructions for updating the function file with each BuddyBoss theme update.
Thanks!