User Tools

Site Tools


core_docs:utility_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
core_docs:utility_functions [2016/06/05 09:16]
Tyblitz [i18n]
core_docs:utility_functions [2016/06/05 09:51] (current)
Tyblitz [find_accesskey]
Line 13: Line 13:
 ===== get_execution_time ===== ===== get_execution_time =====
 ===== getXML ===== ===== getXML =====
 +**Signature**
 +<​code>​getXML($path_to_file)</​code>​
 +
 +**Description**\\
 +Retrieves the XML contents from ''​$path_to_file''​ and returns it as a SimpleXMLExtended object.
 ===== XMLsave ===== ===== XMLsave =====
 +**Signature**
 +<​code>​XMLsave($xml,​ $file)</​code>​
 +
 +**Description**\\
 +Saves (ideally SimpleXMLExtended) ''​$xml''​ objects to the ''​$file''​ path.\\
 +If ''​GSFORMATXML''​ is true, will pretty-print the XML string.\\ ​
 +This function executes the filter ''​xmlsave''​ every time it is called, so that everyone can alter the XML string by using ''​add_filter('​xmlsave',​ '​myFunc'​)''​
 ===== lngDate ===== ===== lngDate =====
-===== shtDate =====+**Signature** 
 +<​code>​lngDate($date)</​code>​ 
 + 
 +**Description**\\ 
 +Returns a date according to the format stored in the global ''​$i18n''​ key''​DATE_AND_TIME_FORMAT'',​ in ''​admin/​lang/''​.\\ 
 +Default format is ''​F jS, Y - g:i A'',​ see [[http://​php.net/​manual/​en/​function.date.php|PHP dates and times]]. 
 +===== shtDate ==== 
 +**Signature** 
 +<​code>​shtDate($date)</​code>​ 
 + 
 +**Description**\\ 
 +Returns a date according to the format stored in the global ''​$i18n''​ key''​DATE_FORMAT'',​ in ''​admin/​lang/''​.\\ 
 +Default format is ''​M j, Y'',​ see [[http://​php.net/​manual/​en/​function.date.php|PHP dates and times]].
 ===== cl ===== ===== cl =====
 **Signature** **Signature**
Line 72: Line 96:
    * ''​$echo''​ //​(optional)//,​ whether to echo or return the value. If ''​$echo''​ is false, acts the same as ''​i18n_r''​    * ''​$echo''​ //​(optional)//,​ whether to echo or return the value. If ''​$echo''​ is false, acts the same as ''​i18n_r''​
 ===== i18n_r ===== ===== i18n_r =====
 +**Signature**
 +<​code>​i18n_r($key)</​code>​
 +
 +**Description**\\
 +Shorthand for ''​i18n($key,​ true)''​. Returns the translation for ''​$key''​.
 ===== i18n_merge ===== ===== i18n_merge =====
 +**Signature**
 +<​code>​i18n_merge($plugin[,​ $language=null])</​code>​
 +
 +**Description**\\
 +Merges a plugin'​s language file with the global ''​$i18n''​ language.
 +
 +**Parameters**
 +     * ''​$plugin'',​ the namespace of the plugin'​s language.
 +     * ''​$language''​ //​(optional)//,​ don't pass unless you want to force a specific language.
 ===== i18n_merge_impl ===== ===== i18n_merge_impl =====
 +**Signature**
 +<​code>​i18n_merge_impl($plugin,​ $lang, &​$globali18n)</​code>​
 +
 +**Description**
 +Used by ''​i18n_merge''​ to do the actual merging of the plugin'​s i18n namespace (in the plugin'​s lang folder) with the global ''​$i18n''​ variable.
 ===== safe_slash_html ===== ===== safe_slash_html =====
 ===== xmlFilterChars ===== ===== xmlFilterChars =====
Line 86: Line 129:
 ===== htmldecode ===== ===== htmldecode =====
 ===== lowercase ===== ===== lowercase =====
 +**Signature**
 +<​code>​lowercase($text)</​code>​
 +
 +**Description**\\
 +Converts ''​$text''​ to lowercase.
 ===== find_accesskey ===== ===== find_accesskey =====
 +**Signature**
 +<​code>​find_accesskey($i18n_string)</​code>​
 +
 +**Description**\\
 +Relies on access keys being enclosed by '<​em></​em>'​ elements in an i18n string. Used especially in the admin'​s main navigation.
 ===== _id ===== ===== _id =====
 ===== defined_array ===== ===== defined_array =====
core_docs/utility_functions.1465118179.txt.gz · Last modified: 2016/06/05 09:16 by Tyblitz