Skip to content

Instantly share code, notes, and snippets.

View umdevelopera's full-sized avatar

UM DeveloperA umdevelopera

View GitHub Profile
@umdevelopera
umdevelopera / um_translate_labels.php
Last active June 20, 2024 18:18
Example. A code used to translate labels in the Ultimate Member member directory. Uses the Polylang or WPML language switcher.
<?php
/**
* Translate labels with Polylang or WPML.
*/
function um_get_translated_labels() {
// EDIT this array of translated labels.
return array(
"first_name" => array(
'en' => 'First Name',
@umdevelopera
umdevelopera / um_checkbox_choices_translate.php
Created January 10, 2024 19:28
Example. A function used to translate choices of the Checkbox field in the Ultimate Member form. Uses the Polylang language switcher.
<?php
// Translate choices of the Checkbox field.
function my_checkbox_item_title( $title, $key, $v ) {
$lang = pll_current_language();
$texts = array(
'um_pet' => array(
'en' => array(
'Cat' => 'Cat',
@umdevelopera
umdevelopera / um_dropdown_choices_translate.php
Last active January 10, 2024 19:36
Example. A function used to translate choices of the Dropdown field in the Ultimate Member form. Uses the Polylang language switcher.
<?php
/**
* Get options for the "Seasons" field with Polylang.
*
* @return array
*/
function um_seasons_options() {
$lang = pll_current_language();