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