simple-job-board.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 https://wordpress.org/plugins/simple-job-board
  11. * @since 1.0.0
  12. * @package Simple_Job_Board
  13. *
  14. * @wordpress-plugin
  15. * Plugin Name: Simple Job Board
  16. * Plugin URI: https://wordpress.org/plugins/simple-job-board/simple-job-board-uri
  17. * Description: Powerful & Robust plugin to create a Job Board on your website in simple & elegant way.
  18. * Version: 2.6.0
  19. * Author: PressTigers
  20. * Author URI: http://pressTigers.com
  21. * License: GPL-3.0+
  22. * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
  23. * Text Domain: simple-job-board
  24. * Domain Path: /languages
  25. */
  26. // If this file is called directly, abort.
  27. if (!defined('WPINC')) {
  28. die;
  29. }
  30. // Define Plugin Contant
  31. if (!defined('SJB_PLUGIN_VERSION')) {
  32. define('SJB_PLUGIN_VERSION', '2.5.0');
  33. }
  34. update_option( 'sjb_version', SJB_PLUGIN_VERSION );
  35. /**
  36. * Show SJB Upgrade Notice
  37. */
  38. function sjb_showUpgradeNotification( $currentPluginMetadata, $newPluginMetadata ) {
  39. // check "upgrade_notice"
  40. if ( isset( $newPluginMetadata->upgrade_notice ) && strlen( trim( $newPluginMetadata->upgrade_notice ) ) > 0) {
  41. echo '<div style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>Important Upgrade Notice:</strong> ' . esc_html($newPluginMetadata->upgrade_notice) . '</div>';
  42. }
  43. }
  44. // Show SJB Upgrade Notice
  45. add_action( 'in_plugin_update_message-simple-job-board/simple-job-board.php', 'sjb_showUpgradeNotification', 10, 2 );
  46. /**
  47. * The code that runs during plugin activation.
  48. * This action is documented in includes/class-simple-job-board-activator.php
  49. */
  50. function activate_simple_job_board() {
  51. require_once plugin_dir_path(__FILE__) . 'includes/class-simple-job-board-activator.php';
  52. Simple_Job_Board_Activator::activate();
  53. }
  54. /**
  55. * The code that runs during plugin deactivation.
  56. * This action is documented in includes/class-simple-job-board-deactivator.php
  57. */
  58. function deactivate_simple_job_board() {
  59. require_once plugin_dir_path(__FILE__) . 'includes/class-simple-job-board-deactivator.php';
  60. Simple_Job_Board_Deactivator::deactivate();
  61. }
  62. register_activation_hook(__FILE__, 'activate_simple_job_board');
  63. register_deactivation_hook(__FILE__, 'deactivate_simple_job_board');
  64. /**
  65. * The core plugin class that is used to define internationalization,
  66. * admin-specific hooks, and public-facing site hooks.
  67. */
  68. require plugin_dir_path(__FILE__) . 'includes/class-simple-job-board.php';
  69. /**
  70. * Begins execution of the plugin.
  71. *
  72. * Since everything within the plugin is registered via hooks,
  73. * then kicking off the plugin from this point in the file does
  74. * not affect the page life cycle.
  75. *
  76. * @since 1.0.0
  77. */
  78. function run_simple_job_board() {
  79. $plugin = new Simple_Job_Board();
  80. $plugin->run();
  81. }
  82. run_simple_job_board();