Skip to content

Instantly share code, notes, and snippets.

@Antoinebr
Last active April 2, 2016 20:26
Show Gist options
  • Select an option

  • Save Antoinebr/c02f51a8145ed1f0fd6e to your computer and use it in GitHub Desktop.

Select an option

Save Antoinebr/c02f51a8145ed1f0fd6e to your computer and use it in GitHub Desktop.
pollylang.md

utiliser pollylang

Enregistrer une chaine

Permet de pouvoir la traduire dans le BO

Dans functions.php faire pour chaque chaine

Il faut tester l'existance de la functions ! Otherwise your site will badly break with a fatal error at next Polylang update (as WordPress deletes the plugin when updtating it).

// ‘$name’ => (required)
// ‘$string’ => (required)
// ‘$multiline’ => (optional)

pll_register_string("Le titre du bouton de menu","menu_title");

Autres infos de doc -> https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/

/**
*
*	Etend la class Helpers avec
*	des functions de traduction
*
*/
class abLang extends Helpers {


  function pll_e($string){
    if (function_exists('pll_e')):
      pll_e($string);
    endif;
  }

}
if (function_exists('pll_register_string')):

  /**
  *
  * HEADER
  *
  */
  pll_register_string("Le titre du bouton de menu","menu_title");



endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment