Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions uls-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,20 +646,6 @@ function uls_tab_background_color_picker() {
<?php
}

// this function is for automatic traduction menues
/*function uls_traduction_automatic_menu($object)
{
foreach ($object as $key ) {
$post_id = get_post_meta($key->object_id, 'uls_translation_'.strtolower(uls_get_user_language()), true);
if ( !empty($post_id) ) {
$key->title = get_post($post_id)->post_title;
$key->url = uls_get_url_translated($key->url);
var_dump('yeah!');
}
}
return $object;
}
//add_filter( 'wp_nav_menu_objects', 'uls_traduction_automatic_menu');*/

// this functin action is for register sidebar if the checkbox in backend is enable
function uls_register_sidebar_laguages() {
Expand Down
17 changes: 17 additions & 0 deletions user-language-switch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,23 @@ function update_db_after_update() {
register_activation_hook( __FILE__, 'update_db_after_update' );


// this function search the front page and show its traduction if it has
// the filter is the option_ this Used to temporarily alter a WordPress option before you display a specific view
// alter the page_on_front action

add_filter('option_page_on_front', 'uls_search_front_page_translation');
function uls_search_front_page_translation($page_on_front) {

if (!empty($page_on_front) ) {
$lang_code = uls_get_site_language(); // get site language
$get_page_translation = get_post_meta($page_on_front,'uls_translation_'.strtolower($lang_code), true); // get language translations

if ( !empty($get_page_translation) ) {
return $get_page_translation;
}
}
return $page_on_front;
}
/*
Moving configuration options to user profile page
*/
Expand Down