Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

This topic contains 2 replies, has 2 voices.

Last updated by sergeyS-14 1 year, 2 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
September 5, 2018 at 2:19 pm #2707533

sergeyS-14

I am on taxonomy or on post_type page (not on default one).

I wold like to get all urls or ID for all translations of current page?

If there is a way to get translated pages?

May be some WPML hook or filter to use for it?

For example:
I got current taxonomy(or post_type) in spanish and the current id is 123

Planing to use with combine of WPML hook "wpml_hreflangs" to change hreflang urls on page:

//not real code, just example i think it may be ok

add_filter( 'wpml_hreflangs', 'hrefs_manipulator_callback' );

function hrefs_manipulator_callback(){
	
$obj_id = get_the_ID();

global $sitepress;

//get_all_translations($obj_id); is function i guessing to be exist

$translations_array = $sitepress->get_all_translations($obj_id);

	foreach ($translations_array as $translation) {
		//do stuff with tranlatinos
	}
}
September 5, 2018 at 3:06 pm #2707755

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

In this link you will find a list of all hooks documented by WPML: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

Kind regards,
Carlos

September 7, 2018 at 1:18 pm #2714861

sergeyS-14

i can read docs by my self... i suppose the support know the necessary hooks. I hope you will inform better and next time answer will be useful.