init.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. require_once BOOKED_PLUGIN_DIR . '/class-tgm-plugin-activation.php';
  3. add_action( 'bookedpa_register', 'booked_register_required_plugins' );
  4. function booked_register_required_plugins(){
  5. $plugins = array(
  6. array(
  7. 'name' => 'Payments with WooCommerce',
  8. 'slug' => 'booked-woocommerce-payments',
  9. 'source' => BOOKED_PLUGIN_DIR . '/includes/add-ons/booked-woocommerce-payments.zip',
  10. 'required' => false,
  11. 'version' => BOOKED_WC_VERSION,
  12. 'force_activation' => false,
  13. 'force_deactivation' => true
  14. ),
  15. array(
  16. 'name' => 'WooCommerce',
  17. 'slug' => 'woocommerce',
  18. 'required' => false,
  19. ),
  20. array(
  21. 'name' => 'Calendar Feeds',
  22. 'slug' => 'booked-calendar-feeds',
  23. 'source' => BOOKED_PLUGIN_DIR . '/includes/add-ons/booked-calendar-feeds.zip',
  24. 'required' => false,
  25. 'version' => BOOKED_CF_VERSION,
  26. 'force_activation' => false,
  27. 'force_deactivation' => true
  28. ),
  29. array(
  30. 'name' => 'Front-End Agents',
  31. 'slug' => 'booked-frontend-agents',
  32. 'source' => BOOKED_PLUGIN_DIR . '/includes/add-ons/booked-frontend-agents.zip',
  33. 'required' => false,
  34. 'version' => BOOKED_FEA_VERSION,
  35. 'force_activation' => false,
  36. 'force_deactivation' => true
  37. ),
  38. );
  39. $config = array(
  40. 'id' => 'booked', // Unique ID for hashing notices for multiple instances of TGMPA.
  41. 'default_path' => '', // Default absolute path to bundled plugins.
  42. 'menu' => 'booked-install-addons', // Menu slug.
  43. 'parent_slug' => 'booked-appointments', // Parent menu slug.
  44. 'capability' => 'manage_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
  45. 'has_notices' => true, // Show admin notices or not.
  46. 'dismissable' => true, // If false, a user cannot dismiss the nag message.
  47. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
  48. 'is_automatic' => true, // Automatically activate plugins after installation or not.
  49. 'message' => '', // Message to output right before the plugins table.
  50. );
  51. bookedpa( $plugins, $config );
  52. }