Add Language and Translations to the REST API (WPML)
Adds wpml_language and wpml_translations fields to posts and pages in the REST API, so headless front ends and apps know each item's language and the IDs of its translations.
Snippet Library
3,040 free snippets from the WPIDE team and the community. Copy the code, or add any snippet to your site in one click with WPIDE.
Adds wpml_language and wpml_translations fields to posts and pages in the REST API, so headless front ends and apps know each item's language and the IDs of its translations.
Appends links to the other WPML languages of the current page at the end of a chosen theme menu, labelled with each language's native name.
Points WPML's x-default hreflang tag at the language you choose, for example English, instead of the site's default language.
Sends comment moderation emails to a different moderator depending on the language of the post, using WPML, Polylang or each post's language box, so every comment reaches someone who reads it.
Copies the custom fields you list from an original post to all of its WPML translations whenever the original is saved, for values like prices, SKUs or coordinates that never change between languages.
Adds classes like lang-fr and dir-rtl to the body tag, so you can adjust styles per language, whether the language comes from WPML, Polylang or the WordPress locale.
Adds a dashboard widget that lists your 20 most recent posts and pages in the default language with the languages they still need translating into.
Swaps the site logo set in the Customizer for a language-specific image, using the language from WPML, Polylang or the WordPress locale.
Adds a "Translations" menu to the toolbar on single posts and pages with a link to edit each language version, so editors can hop between translations without searching.
Adds a [wpide_wpml_switcher] shortcode that prints an accessible list or dropdown of your WPML languages, with native names, codes or flags, anywhere you can place a shortcode.
Adds a [wpide_wpml_link id="123"] shortcode that links to the translation of a page in the language being viewed, using that translation's title, so internal links never send visitors to the wrong language.
Registers the text of selected site options, for example a plugin's notice text or a cookie banner message, in WPML String Translation and returns the right translation on the front end.
Adds a short notice above posts that WPML displays in the default language because no translation exists yet ("display as translated" mode), so visitors know why the text is not in their language.
Stops WPML from printing hreflang tags on page 2+ of archives, search results and URLs with query strings, where the alternates often point at mismatched pages.
When a visitor hits a missing page in a non-default WPML language, sends them to the homepage of that language instead of a 404, keeping them in their language.
Sets Mailchimp's built-in subscriber language for every signup from your site, using the current WordPress, WPML or Polylang language, so Mailchimp can send the right translation of your campaigns.
Adds a [wpide_wpml_field] shortcode that displays a custom field from the current-language version of any post or page, so one shortcode works in every language.
Shows a slim announcement bar at the top of every page whose text you translate in WPML > String Translation, so each language gets its own message.
Adds a [wpide_t name="..."]Text[/wpide_t] shortcode that registers its text in WPML String Translation and shows the translation, ideal for short phrases in widgets, footers and page builder text.
Registers chosen Customizer (theme_mod) text settings, such as a footer copyright or header phone number, in WPML String Translation and shows the translated value in each language.
Shows a completely different menu in a theme location for each WPML language, for sites whose language versions have different structures rather than translated copies.