ddw_gftb_init

Load the text domain for translation of the plugin.

Description

ddw_gftb_init(); 

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


Usage

  1. if ( !function_exists( 'ddw_gftb_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-toolbar/gravity-forms-toolbar.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_gftb_init(); 
  7.  

Defined (1)

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

/gravity-forms-toolbar.php  
  1. function ddw_gftb_init() { 
  2.  
  3. /** Set unique textdomain string */ 
  4. $gftb_textdomain = 'gravity-forms-toolbar'; 
  5.  
  6. /** The 'plugin_locale' filter is also used by default in load_plugin_textdomain() */ 
  7. $locale = apply_filters( 'plugin_locale', get_locale(), $gftb_textdomain ); 
  8.  
  9. /** Set filter for WordPress languages directory */ 
  10. $gftb_wp_lang_dir = apply_filters( 
  11. 'gftb_filter_wp_lang_dir',  
  12. trailingslashit( WP_LANG_DIR ) . 'gravity-forms-toolbar/' . $gftb_textdomain . '-' . $locale . '.mo' 
  13. ); 
  14.  
  15. /** Translations: First, look in WordPress' "languages" folder = custom & update-secure! */ 
  16. load_textdomain( $gftb_textdomain, $gftb_wp_lang_dir ); 
  17.  
  18. /** Translations: Secondly, look in plugin's "languages" folder = default */ 
  19. load_plugin_textdomain( $gftb_textdomain, FALSE, GFTB_PLUGIN_BASEDIR . 'languages' ); 
  20.  
  21.  
  22. /** If 'wp-admin' include admin functions */ 
  23. if ( is_admin() ) { 
  24.  
  25. /** Plugin admin settings */ 
  26. require_once( GFTB_PLUGIN_DIR . 'admin/admin.php' ); 
  27.  
  28. /** Gravity Forms settings integrations */ 
  29. require_once( GFTB_PLUGIN_DIR . 'lib/gftb-admin-settings.php' ); 
  30.  
  31. /** Plugin admin extras (help) */ 
  32. require_once( GFTB_PLUGIN_DIR . 'lib/gftb-admin-extras.php' ); 
  33.  
  34. } // end if is_admin() check 
  35.  
  36. /** Add "Settings Page" link to plugin page - only within 'wp-admin' */ 
  37. if ( is_admin() 
  38. && ( current_user_can( 'gravityforms_edit_forms' ) || current_user_can( 'gform_full_access' ) ) 
  39. ) { 
  40.  
  41. add_filter( 
  42. 'plugin_action_links_' . plugin_basename( __FILE__ ),  
  43. ); 
  44.  
  45. } // end if admin & cap check 
  46.  
  47. /** Define constants and set defaults for removing all or certain sections */ 
  48. if ( ! defined( 'GFTB_DISPLAY' ) ) { 
  49. define( 'GFTB_DISPLAY', TRUE ); 
  50.  
  51. if ( ! defined( 'GFTB_ADDONS_DISPLAY' ) ) { 
  52. define( 'GFTB_ADDONS_DISPLAY', TRUE ); 
  53.  
  54. if ( ! defined( 'GFTB_EXTENSIONS_DISPLAY' ) ) { 
  55. define( 'GFTB_EXTENSIONS_DISPLAY', TRUE ); 
  56.  
  57. if ( ! defined( 'GFTB_RESOURCES_DISPLAY' ) ) { 
  58. define( 'GFTB_RESOURCES_DISPLAY', TRUE ); 
  59.  
  60. if ( ! defined( 'GFTB_DE_DISPLAY' ) ) { 
  61. define( 'GFTB_DE_DISPLAY', TRUE ); 
  62.  
  63. if ( ! defined( 'GFTB_NL_DISPLAY' ) ) { 
  64. define( 'GFTB_NL_DISPLAY', TRUE ); 
  65.  
  66. if ( ! defined( 'GFTB_ES_DISPLAY' ) ) { 
  67. define( 'GFTB_ES_DISPLAY', TRUE ); 
  68.  
  69. } // end of function ddw_gftb_init