Eric @ EricBess WebHome

Wins do not arrogant, not to lose hungry, there is shock chest and face, such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

wordpress shortCode API

wordpress2.5 added a new code of Jane (shortCode) API, is a simple set of functions for the creation of content published in the macro code. Jane in the form of code as follows: [play] or [codebox ]...[/ codebox]

With Jane code API, support for the creation of the following key attributes of Jane becomes easy. Jane API code to deal with all forms of analytical work, Jane is no longer required for each code corresponding to prepare regular expressions. Helper functions are also included into the API for access to the default settings and attributes. The self-closing and the closure of the passive Jane code, API will provide support.

Overview

Jane is the code used to provide the handler. Jane processor code on a large program similar to the wordpress filters filter: They have to accept parameters (Attributes) and return the results (Jane output code). Function add_shortcode () for the registration of processor yd Jane. It has two parameters: A code name (for the article itself string) and the function of the processor. Jane processor code functions should be 1-2 parameters: $ atts (an array of properties) and $ content (which content) (if Jane contains the code for the form).
For example: function my_shortcode_handler ($ atts, $ content = null) () for the registration of processor yd Jane API call,
In the form are as follows: add_shortcode ( 'my-shortcode', 'my_shortcode_handler');

When the show the_content, Jane API code would resolve all of Jane's code, such as "[my-shortcode]", if there is property and content, will be separated from them and resolve them, and then passed to the processor code Jane Function. Any return String by the processor would be inserted into the article itself, to replace Jane code. Jane code attributes are as follows: [my-shortcode foo = "bar" baz = "bing"] code content ........[/ my-shortcode] they will be linked into an array (see below), as a $ atts Parameters passed to the function processor; $ content as the content delivery.
array ( 'foo' => 'bar', 'baz' => 'bing') is associated with an array of key attributes, while the corresponding value is the value of the property.

Click to continue reading

June 13th, 2008 Posted by eric | Wordpress Programming | no comments

Internationalization of the Blog-Global Translator (translation plug-in)

If you want to own more internationalized Blog worth a try: Wordpress Global Translator Plugin, a Blog to provide translation of the plug-in functions can be combined with Google, Promt and Altavista Babel Fish translation service provided to your Blog article translation .

In fact, the plug-in features much more than simple translation, also contribute to the SEO search engine optimization, which can generate articles for every article asked, and to include search engine will help increase traffic, in fact, I have to deploy Global Translator a week after the visit to increase international. It also provides other features cache (space) and from the definition adopted by the CSS style of the translation button.

Installation method:

1, download the plug-in, to upload Wordpress plug-in directory, activate the background. Access to options -> Global Translator menu, select the translation service (I am here elections, only Google Translation Services to work properly, but you can also try other), select your Blog language, open the cache option, you can save.

2, in the template (I head.php) insert the following code.

? View Code PHP
 1 
 2 
 3 
 4 
 5 
  <? Php> 
  function_exists ( "gltr_build_flags_bar" ) ) { if (function_exists ( "gltr_build_flags_bar")) ( 
  gltr_build_flags_bar (); 
  ) 
  ?> 

Click to continue reading

May 26th, 2008 Posted by eric | WordPress | no comments