Dans cette table sont regroupés les widgets, template tags, fonctions et filtre disponibles dans xili-language. (Mars 2015: en cours de finition et complétion à partir de la version précédente qui datait de 2010 😉 ).Bien sûr les meilleurs infos sont dans le source lui-même après la classe xili_language. Il est aussi recommandé d’examiner les sources exemples des thèmes enfant multilingues comme celui-ci même.
Ce regroupement des éléments techniques est destiné aux webmestres avertis et aux développeurs de thèmes.
Toolbox: xili-language plugin for a multilingual website in one table | ||||||||
Name | Definition | Comment | Example | Concern | ||||
WIDGETS | to enrich widget enable themes | Theme | ||||||
Languages list | Display the list of available languages | Multiple widgets possible. If your theme contains functions that offer widget personalization, the item type must be filled. (see this post) |
![]() |
sidebar | ||||
Recent comments | Display the list of recent comments in current displayed language. |
This widget was created because the default one cannot be translatable or offer sub-selection in one language. multiple widgets possible |
![]() |
sidebar | ||||
Recent posts | Display list of recent posts in a choosen language |
since v 1.4.0 for WP >2.8 This new widget solves conflicts or issues occuring when WP default widget is present (contains an obscur wp_reset_query ). Also a choice of language of this list of recent posts is possible – not necessary the same of the current page. And you can install multiple widgets. Replace WP Recent Widget by this one named – List of recent posts –multiple widgets possible with different languages (fixed or dynamic) |
![]() |
sidebar | ||||
TEMPLATE TAGS | usable by theme’s designer and webmaster | Theme | ||||||
xiliml_the_other_posts default parameters: ($post_ID,$before = “This post in”, $separator = “, “, $type = “display”) |
in loop display the link of other posts defined as in other languages |
can be used in theme template in single.php under the title * example: if(class_exists(‘xili_language’)) xiliml_the_other_posts($post->ID) (in the example, the default template tag was hooked to display flag – see hooks rows below) |
![]() |
post – page – loop | ||||
xili_post_language default parameters: ($before = ‘<span class=”xili-lang”>(‘, $after =’)</span>’) |
in loop display the language of the post | Useful inside a multilingual category loop. |
|
loop, category, search | ||||
xili_language_list default parameters: ($before = ‘<li>’, $after ='</li>’, $theoption=”) |
outside loop (sidebar) display the languages of the site (used also by widget) | When the theme don’t enable widget. Use this template tag to display the list in sidebar or (header and footer) |
|
sidebar | ||||
xiliml_the_category default parameters: ($post_ID, $separator = ‘, ‘ ,$echo = true) |
replace the_category() tag of WP Core | The current template tag the_category is not hookable by plugin. So here the categories list of a post inside loop will be translated according the language of the current post. |
|
post – page – loop | ||||
xiliml_langinsearchform default parameters: ($before=”,$after=”) |
Template Tag insertable in search form for sub-selection of a language | As in example, this function add a way to limit the search to a target language. |
![]()
|
search – sidebar | ||||
FUNCTIONS | usable by developer with knowledges in php (see php source) | CMS | ||||||
the_curlang() | deprecated | replaced by |
xili_curlang()
|
theme | ||||
the_cur_langs_group_id() | ||||||||
the_xili_local_time default parameters: ($format=’%B %d, %Y’,$time = null) |
time | |||||||
get_cur_language ($post_ID) | Return the language of current post in loop | see below | loop | |||||
get_cur_post_lang_dir ($post_ID) | Return the lang and dir of language of current post in loop. | The example on right uses this tag and the above one. |
|
loop | ||||
xiliml_get_lang_object_of_post ($post_ID) | Return language object of a post. | loop | ||||||
choice_of_browsing_language() | Return the language of current browser. | visitor’s browser | ||||||
choice_of_browsing_lang_dir() | Return the lang and dir of current browser. | visitor’s browser lang and direction | ||||||
add_again_filter ($filtername,$filterfunction) | Activate hooks of plugin in class. | Reserved for high level developers – see code of function below | ||||||
xiliml_get_category_link ($catid = 0) | Replace get_category_link to bypass hook from xili_language | |||||||
xiliml_recent_comments | Recent comments – used by xili widget – usable if you need to create your own template tag | comments | ||||||
xiliml_get_language ($lang_nameorslug=””) | Return full object of a language | |||||||
ex_pages_by_lang ($pages, $r) | sub selection of pages for wp_list_pages() | example to use as hook | sidebar | |||||
function xiliml_force_loop_lang ($lang_query_tag) | functions to change loop’s query tag of language |
useful for sidebar widgets and latest posts widget – since 1.3.0 Even if the main loop is in one language, in the sidebar, it is possible to “force” the language in another one for the widgets. |
Another example :
|
sidebar, widget | ||||
xiliml_add_lang_to_parsed_query () | function for filter ‘parse_query’ to authorize lang query tag in custom WP_Query() |
since 1.4.0 useful for function or plugin that put posts inside post… |
|
loop, custom queries | ||||
SHORTCODE | ||||||||
linked post | example of shortcode using plugin functions | this code can be inserted in dedicaced functions detectable inside this folder: wp-content/plugins/xilidev-libraries – see this post – |
|
post content | ||||
HOOKS |
Main functions and template tags of xili-language are modifiable by hooks to have better and adapted CMS behaviour. It is useful for developer with deep knowledges in php and wp (see end of php source) |
CMS | ||||||
xiliml_the_category add_action (‘xiliml_the_category’,’your_xiliml_the_category’,10,3) |
template tag | |||||||
xiliml_the_other_posts add_action(‘xiliml_the_other_posts’,’your_xiliml_the_other_posts’,10,3) |
template tag | |||||||
xili_post_language add_action(‘xili_post_language’,’your_xili_post_language’,10,2) |
template tag | |||||||
xili_language_list add_action(‘xili_language_list’,’your_xili_language_list’,10,3) |
In this example described formerly, the list of languages is enriched by flags:
|
template tag | ||||||
xiliml_langinsearchform add_action(‘xiliml_langinsearchform’,’your_xiliml_langinsearchform’,10,2) |
sidebar | |||||||
xiliml_cat_language add_filter(‘xiliml_cat_language’,’my_rules_for_cat_language’,2,3); |
Exemple to show translated and original item
|
sidebar wp list categories content |
||||||
head_insert_language_metas add_filter(‘head_insert_language_metas’,’my_head_insert_language_metas’,1,2); |
header xhtml | |||||||
head_language_attributes add_filter(‘head_language_attributes’,’my_ head_language_attributes’,1,1); |
header xhtml | |||||||
xiliml_cur_lang_head add_filter(‘xiliml_cur_lang_head’,’my_xiliml_cur_lang_head’,1); |
default rules – set curlang in head according rules | multilingual behaviour (front, cat, search,…) | ||||||
More technical hooks and filters inside xili-language (Read the plugin php source for more infos) |
||||||||
choice_of_browsing_language | ||||||||
xiliml_link_translate_desc | ||||||||
xiliml_single_cat_title_translate | used by filter for wp_title() tags – since 1.4.1 | |||||||
xiliml_getarchives_where | ||||||||
xiliml_getarchives_join | ||||||||
xiliml_modify_querytag | ||||||||
xiliml_taglink_append_lang | ||||||||
xiliml_link_append_lang | ||||||||
xili_nav_lang_list |
usable to change the automatic insertion of languages list in navigation menu. Example:
|
|||||||
xili_nav_page_list | usable to change the automatic insertion of sub-selection of pages : see source | |||||||
OTHER FILTERS | Some template tags inside WP core are not fully multilingual and need filters. |
| ||||||
the_time add_filter(‘the_time’,’my_date’,10,2); |
Date management and translation are very complicated. Here by using a xili-language function, it is possible to modify the basic behaviour of the current template tag the_time. |
|
Post, Page | |||||
the_modified_time add_filter(‘the_modified_time’,’my_modified_date’,10,2); |
Date management and translation are very complicated. Here by using a xili-language function, it is possible to modify the basic behaviour of the current template tag the_modified_time. |
|
Post, Page | |||||
get_comment_date add_filter(‘get_comment_date’,’my_comment_date’,10,2); |
This is the date of each comments in the comments loop. |
|
Comments | |||||
© dev.xiligroup.com | 2010 – 2015-03 |