nguages) && !empty($languages)) { $output .= ""; $output .=" "; } return $output; } } if(!function_exists('avia_wpml_filter_dropdown_post_query')) { add_filter( 'avf_dropdown_post_query', 'avia_wpml_filter_dropdown_post_query', 10, 4); function avia_wpml_filter_dropdown_post_query($prepare_sql, $table_name, $limit, $element) { global $wpdb; $wpml_lang = ICL_LANGUAGE_CODE; $wpml_join = " INNER JOIN {$wpdb->prefix}icl_translations ON {$table_name}.ID = {$wpdb->prefix}icl_translations.element_id "; $wpml_where = " {$wpdb->prefix}icl_translations.language_code LIKE '{$wpml_lang}' AND "; $prepare_sql = "SELECT distinct ID, post_title FROM {$table_name} {$wpml_join} WHERE {$wpml_where} post_status = 'publish' AND post_type = '".$element['subtype']."' ORDER BY post_title ASC LIMIT {$limit}"; return $prepare_sql; } } if(!function_exists('avia_change_wpml_home_link')) { add_filter('WPML_filter_link','avia_change_wpml_home_link', 10, 2); function avia_change_wpml_home_link($url, $lang) { global $sitepress; if(is_home() || is_front_page()) $url = $sitepress->language_url($lang['language_code']); return $url; } } if(!function_exists('avia_wpml_slideshow_slide_id_check')) { add_filter( 'avf_avia_builder_slideshow_filter', 'avia_wpml_slideshow_slide_id_check', 10, 1); function avia_wpml_slideshow_slide_id_check($slideshow_data) { $id_array = $slideshow_data['id_array']; $slides = $slideshow_data['slides']; if(empty($id_array) || empty($slides)) return $slideshow_data; foreach($id_array as $key => $id) { if(!isset($slides[$id])) { $id_of_translated_attachment = icl_object_id($id, "attachment", true); if($id_of_translated_attachment && isset($slides[$id_of_translated_attachment])) { $slides[$id] = $slides[$id_of_translated_attachment]; unset($slides[$id_of_translated_attachment]); } } } $slideshow_data['slides'] = $slides; return $slideshow_data; } } if(!function_exists('avia_wpml_author_name_translation')) { add_filter( 'avf_author_name', 'avia_wpml_author_name_translation', 10, 2); function avia_wpml_author_name_translation($name, $author_id) { if(function_exists('icl_t')) $name = icl_t('Authors', 'display_name_'.$author_id, $name); return $name; } } if(!function_exists('avia_wpml_author_nickname_translation')) { add_filter( 'avf_author_nickname', 'avia_wpml_author_nickname_translation', 10, 2); function avia_wpml_author_nickname_translation($name, $author_id) { if(function_exists('icl_t')) $name = icl_t('Authors', 'nickname_'.$author_id, $name); return $name; } } if(!function_exists('avia_append_lang_flags')) { //first append search item to main menu add_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 ); add_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 ); function avia_append_lang_flags( $items, $args ) { if ((is_object($args) && $args->theme_location == 'avia')) { global $avia_config, $sitepress; if(empty($avia_config['wpml_language_menu_position'])) $avia_config['wpml_language_menu_position'] = apply_filters('avf_wpml_language_switcher_position', 'main_menu'); if($avia_config['wpml_language_menu_position'] != 'main_menu') return $items; $languages = icl_get_languages('skip_missing=0&orderby=custom'); if(is_array($languages)) { foreach($languages as $lang) { $currentlang = (ICL_LANGUAGE_CODE == $lang['language_code']) ? 'avia_current_lang' : ''; if(is_home() || is_front_page()) $lang['url'] = $sitepress->language_url($lang['language_code']); $items .= "
  • "; $items .= " "; $items .= "
  • "; } } } return $items; } } if(!function_exists('avia_wpml_translate_date_format')) { function avia_wpml_translate_date_format($format) { if (function_exists('icl_translate')) $format = icl_translate('Formats', $format, $format); return $format; } add_filter('option_date_format', 'avia_wpml_translate_date_format'); } if(!function_exists('avia_translate_ids_from_query')) { function avia_translate_ids_from_query($query, $params) { $res = array(); if(!empty($query['tax_query'][0]['terms']) && !empty($query['tax_query'][0]['taxonomy'])) { foreach ($query['tax_query'][0]['terms'] as $id) { $xlat = icl_object_id($id, $query['tax_query'][0]['taxonomy'], true); if(!is_null($xlat)) $res[] = $xlat; } if(!empty($res)) $query['tax_query'][0]['terms'] = $res; } else if(!empty($query['post__in']) && !empty($query['post_type'])) { foreach($query['post__in'] as $id) { $xlat = icl_object_id($id, $query['post_type'], true); if(!is_null($xlat)) $res[] = $xlat; } if(!empty($res)) $query['post__in'] = $res; } return $query; } add_filter('avia_masonry_entries_query', 'avia_translate_ids_from_query', 10, 2); add_filter('avia_post_grid_query', 'avia_translate_ids_from_query', 10, 2); add_filter('avia_post_slide_query', 'avia_translate_ids_from_query', 10, 2); add_filter('avia_blog_post_query', 'avia_translate_ids_from_query', 10, 2); } } /*compatibility function for the portfolio problems*/ if(!function_exists('avia_portfolio_compat') && defined('ICL_SITEPRESS_VERSION') && defined('ICL_LANGUAGE_CODE')) { add_action( 'avia_action_before_framework_init', 'avia_portfolio_compat', 30); function avia_portfolio_compat() { global $avia_config; if(empty($avia_config['wpml']['settings']['custom_posts_sync_option']) || empty($avia_config['wpml']['settings']['custom_posts_sync_option']['portfolio'])) { $settings = get_option('icl_sitepress_settings'); $settings['custom_posts_sync_option']['portfolio'] = 1; $settings['taxonomies_sync_option']['portfolio_entries'] = 1; update_option('icl_sitepress_settings', $settings); } } } Parse error: syntax error, unexpected $end in C:\web2\paulraff\WORDPRESS\wp-content\themes\prs\config-templatebuilder\avia-shortcodes\page_split.php on line 107