Boilerplate to develop Wordpress Plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.2 KiB

4 years ago
  1. <?php
  2. /**
  3. * The plugin bootstrap file
  4. *
  5. * This file is read by WordPress to generate the plugin information in the plugin
  6. * admin area. This file also includes all of the dependencies used by the plugin,
  7. * registers the activation and deactivation functions, and defines a function
  8. * that starts the plugin.
  9. *
  10. * @link Test
  11. * @since 1.0.0
  12. * @package Test
  13. *
  14. * @wordpress-plugin
  15. * Plugin Name: Test
  16. * Plugin URI: test
  17. * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
  18. * Version: 1.0.0
  19. * Author: test
  20. * Author URI: Test
  21. * License: GPL-2.0+
  22. * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  23. * Text Domain: test
  24. * Domain Path: /languages
  25. *
  26. */
  27. if (!defined('ABSPATH')) {
  28. exit; // Exit if accessed directly
  29. }
  30. /**
  31. * Currently plugin version.
  32. * Start at version 1.0.0 and use SemVer - https://semver.org
  33. * Rename this for your plugin and update it as you release new versions.
  34. *
  35. */
  36. define('TEST_VERSION', '1.0.0');
  37. /**
  38. * The code that runs during plugin activation.
  39. * This action is documented in includes/class-test-activator.php
  40. *
  41. */
  42. function activate_test() {
  43. require_once plugin_dir_path( __FILE__ ).'includes/class-core-activator.php';
  44. Test_Activator::activate();
  45. }
  46. /**
  47. * The code that runs during plugin deactivation.
  48. * This action is documented in includes/class-test-deactivator.php
  49. *
  50. */
  51. function deactivate_test() {
  52. require_once plugin_dir_path( __FILE__ ).'includes/class-core-deactivator.php';
  53. Test_Deactivator::deactivate();
  54. }
  55. register_activation_hook( __FILE__, 'activate_test');
  56. register_deactivation_hook( __FILE__, 'deactivate_test');
  57. /**
  58. * The core plugin class that is used to define internationalization,
  59. * admin-specific hooks, and public-facing site hooks.
  60. *
  61. */
  62. require plugin_dir_path( __FILE__ ).'includes/class-core.php';
  63. /**
  64. * Begins execution of the plugin.
  65. *
  66. * Since everything within the plugin is registered via hooks,
  67. * then kicking off the plugin from this point in the file does
  68. * not affect the page life cycle.
  69. *
  70. * @since 1.0.0
  71. */
  72. function run_test() {
  73. $plugin = new Test();
  74. }