ddw_wcde_init

Load the text domain for translation of the plugin.

Description

ddw_wcde_init(); 

Load admin helper functions - only within wp-admin..


Usage

  1. if ( !function_exists( 'ddw_wcde_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/woocommerce-de.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_wcde_init(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/woocommerce-de.php  
  1. function ddw_wcde_init() { 
  2.  
  3. /** Load translations, plus include admin specific functions */ 
  4. if ( is_admin() ) { 
  5.  
  6. /** Set unique textdomain string */ 
  7. $wcde_textdomain = 'woocommerce-german'; 
  8.  
  9. /** The 'plugin_locale' filter is also used by default in load_plugin_textdomain() */ 
  10. $locale = apply_filters( 'plugin_locale', get_locale(), $wcde_textdomain ); 
  11.  
  12. /** Set filter for WordPress languages directory */ 
  13. $wcde_wp_lang_dir = apply_filters( 
  14. 'wcde_filter_wp_lang_dir',  
  15. trailingslashit( WP_LANG_DIR ) . 'woocommerce-german/' . $wcde_textdomain . '-' . $locale . '.mo' 
  16. ); 
  17.  
  18. /** Translations: First, look in WordPress' "languages" folder = custom & update-secure! */ 
  19. if ( is_readable( $wcde_wp_lang_dir ) ) { 
  20. load_textdomain( $wcde_textdomain, $wcde_wp_lang_dir ); 
  21.  
  22. /** Translations: Secondly, look in plugin's "languages" folder = default */ 
  23. load_plugin_textdomain( $wcde_textdomain, FALSE, WCDE_PLUGIN_BASEDIR . 'wcde-languages' ); 
  24.  
  25.  
  26. /** Include admin helper functions */ 
  27. require_once( WCDE_PLUGIN_DIR . 'includes/wcde-admin-extras.php' ); 
  28.  
  29. } // end if 
  30.  
  31. /** Add "Settings Page" link to plugin page - only within 'wp-admin' */ 
  32. if ( is_admin() && current_user_can( 'manage_woocommerce' ) ) { 
  33.  
  34. add_filter( 
  35. 'plugin_action_links_' . plugin_basename( __FILE__ ),  
  36. ); 
  37.  
  38. } // end if is_admin() & cap check 
  39.  
  40. /** Include deprecated classes/ functions */ 
  41. require_once( WCDE_PLUGIN_DIR . 'includes/wcde-deprecated.php' ); 
  42.  
  43. } // end of function ddw_wcde_init