membership2_init_free_app

Initializes constants and create the main plugin object MS_Plugin.

Description

membership2_init_free_app(); 

This function is called *instantly* when this file was loaded.


Usage

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

Defined (1)

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

/membership.php  
  1. function membership2_init_free_app() { 
  2. if ( defined( MS_PLUGIN ) ) { 
  3. if ( is_admin() ) { 
  4. // Can happen in Multisite installs where a sub-site has activated the 
  5. // plugin and then the plugin is also activated in network-admin. 
  6. printf( 
  7. '<div class="notice error"><p><strong>%s</strong>: %s</p></div>',  
  8. sprintf( 
  9. __( 'Could not load the plugin %s, because another version of the plugin is already loaded', 'membership2' ),  
  10. 'Membership 2 (free)' 
  11. ),  
  12. MS_PLUGIN. ' (v' . MS_PLUGIN_VERSION . ')' 
  13. ); 
  14. return; 
  15.  
  16. /** 
  17. * Plugin version 
  18. * @since 1.0.0 
  19. */ 
  20. define( 'MS_PLUGIN_VERSION', '4.0.0.6' ); 
  21.  
  22. /** 
  23. * Plugin identifier constant. 
  24. * @since 1.0.0 
  25. */ 
  26. define( MS_PLUGIN, plugin_basename( __FILE__ ) ); 
  27.  
  28. /** 
  29. * Plugin name dir constant. 
  30. * @since 1.0.0 
  31. */ 
  32. define( 'MS_PLUGIN_NAME', dirname(MS_PLUGIN) ); 
  33.  
  34. // WPMUDEV Dashboard is PRO ONLY! 
  35. $externals = array( 
  36. dirname( __FILE__ ) . '/lib/wpmu-lib/core.php',  
  37. dirname( __FILE__ ) . '/lib/wdev-frash/module.php',  
  38. ); 
  39.  
  40. foreach ( $externals as $path ) { 
  41. require_once $path; 
  42.  
  43. // Register the current plugin. 
  44. do_action( 
  45. 'wdev-register-plugin',  
  46. /** Plugin ID */ plugin_basename( __FILE__ ),  
  47. /** Plugin Title */ 'Membership 2',  
  48. /** https://wordpress.org */ '/plugins/membership/',  
  49. /** Email Button CTA */ __( 'Get Members!', 'membership2' ),  
  50. /** getdrip Plugin param */ 'Membership' 
  51. ); 
  52.  
  53. /** 
  54. * Translation. 
  55. * Tip: 
  56. * The translation files must have the filename [TEXT-DOMAIN]-[locale].mo 
  57. * Example: membership2-en_EN.mo / membership2-de_DE.mo 
  58. */ 
  59. function _membership2_translate_plugin() { 
  60. load_plugin_textdomain( 
  61. 'membership2',  
  62. false,  
  63. dirname( plugin_basename( __FILE__ ) ) . '/languages' 
  64. ); 
  65. add_action( 'plugins_loaded', '_membership2_translate_plugin' ); 
  66.  
  67. if ( defined( 'WP_DEBUG' ) && WP_DEBUG || WDEV_DEBUG ) { 
  68. // Load development/testing code before the plugin is initialized. 
  69. $testfile = dirname( __FILE__ ) . '/tests/wp/init.php'; 
  70. if ( file_exists( $testfile ) ) { include $testfile; } 
  71.  
  72. /** 
  73. * Create an instance of the plugin object. 
  74. * This is the primary entry point for the Membership plugin. 
  75. * @since 1.0.0 
  76. */ 
  77. MS_Plugin::instance();