| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: JobWP |
| 4 |
* Plugin URI: https://wordpress.org/plugins/jobwp/ |
| 5 |
* Description: Display job listings in a career page and allow users to apply directly to your site. |
| 6 |
* Version: 2.3.2 |
| 7 |
* Author: HM Plugin |
| 8 |
* Author URI: https://hmplugin.com |
| 9 |
* Requires at least: 5.2 |
| 10 |
* Requires PHP: 7.2 |
| 11 |
* Tested up to: 6.4.2 |
| 12 |
* Text Domain: jobwp |
| 13 |
* Domain Path: /languages/ |
| 14 |
* License: GPL-2.0+ |
| 15 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 16 |
*/ |
| 17 |
|
| 18 |
if ( ! defined( 'ABSPATH' ) ) { |
| 19 |
exit; |
| 20 |
} |
| 21 |
|
| 22 |
if ( function_exists( 'job_fs' ) ) { |
| 23 |
|
| 24 |
job_fs()->set_basename( false, __FILE__ ); |
| 25 |
|
| 26 |
} else { |
| 27 |
|
| 28 |
if ( ! class_exists('JobWp_Master') ) { |
| 29 |
|
| 30 |
define('JOBWP_PATH', plugin_dir_path(__FILE__)); |
| 31 |
define('JOBWP_ASSETS', plugins_url('/assets/', __FILE__)); |
| 32 |
define('JOBWP_SLUG', plugin_basename(__FILE__)); |
| 33 |
define('JOBWP_PRFX', 'jobwp_'); |
| 34 |
define('JOBWP_CLS_PRFX', 'cls-jobwp-'); |
| 35 |
define('JOBWP_TXT_DOMAIN', 'jobwp'); |
| 36 |
define('JOBWP_VERSION', '2.3.2'); |
| 37 |
|
| 38 |
require_once JOBWP_PATH . '/lib/freemius-integrator.php'; |
| 39 |
require_once JOBWP_PATH . 'inc/' . JOBWP_CLS_PRFX . 'master.php'; |
| 40 |
$jobwp = new JobWp_Master(); |
| 41 |
register_activation_hook(__FILE__, array($jobwp, JOBWP_PRFX . 'create_tables')); |
| 42 |
$jobwp->jobwp_run(); |
| 43 |
|
| 44 |
// rewrite_rules upon plugin activation |
| 45 |
register_activation_hook( __FILE__, 'jobwp_myplugin_activate' ); |
| 46 |
function jobwp_myplugin_activate() { |
| 47 |
if ( ! get_option( 'jobwp_flush_rewrite_rules_flag' ) ) { |
| 48 |
add_option( 'jobwp_flush_rewrite_rules_flag', true ); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
add_action( 'init', 'jobwp_flush_rewrite_rules_maybe', 10 ); |
| 53 |
function jobwp_flush_rewrite_rules_maybe() { |
| 54 |
if( get_option( 'jobwp_flush_rewrite_rules_flag' ) ) { |
| 55 |
flush_rewrite_rules(); |
| 56 |
delete_option( 'jobwp_flush_rewrite_rules_flag' ); |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
} |
| 61 |
} |