Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Bobby 1 year, 10 months ago.

Assisted by: Bobby.

Author Posts
September 19, 2023 at 10:41 am #14418789

wayneP-6

Tell us what you are trying to do?

In my theme header we have a my account button. I am trying to make this WPML compatible.

I can use apply_filters( 'wpml_element_link', 500 ) which outputs the full anchor tag <A href="#urlhere">My account

But i don't want to output the full anchor tag, we just need the URL so we can update the href part of our code

Here is what i need to do

<?php echo esc_html__('My Account', 'dpr-bruno'); ?>

How can I do this?

September 20, 2023 at 10:24 pm #14433695

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

What are your results if you used the WP function get_permalink() which I believe allows you to filter for the permalink directly?

https://developer.wordpress.org/reference/functions/get_permalink/

The topic ‘[Closed] apply_filters( 'wpml_element_link', 1 – gives an anchor tag, we need url’ is closed to new replies.