PluginProbe
WP Job Manager / 1.14.0
WP Job Manager v1.14.0
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.11.0 1.11.1 1.12.0 1.12.1 1.13.0 1.14.0 1.15.0 All 154 releases
wp-job-manager / wp-job-manager.php
wp-job-manager.php
115 lines 4.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: WP Job Manager
4 Plugin URI: https://wpjobmanager.com/
5 Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
6 Version: 1.14.0
7 Author: Mike Jolley
8 Author URI: http://mikejolley.com
9 Requires at least: 3.8
10 Tested up to: 4.0
11 Text Domain: wp-job-manager
12 Domain Path: /languages
13
14 Copyright: 2013 Mike Jolley
15 License: GNU General Public License v3.0
16 License URI: http://www.gnu.org/licenses/gpl-3.0.html
17 */
18
19 // Exit if accessed directly
20 if ( ! defined( 'ABSPATH' ) ) {
21 exit;
22 }
23
24 /**
25 * WP_Job_Manager class.
26 */
27 class WP_Job_Manager {
28
29 /**
30 * Constructor - get the plugin hooked in and ready
31 */
32 public function __construct() {
33 // Define constants
34 define( 'JOB_MANAGER_VERSION', '1.14.0' );
35 define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
36 define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
37
38 // Includes
39 include( 'includes/class-wp-job-manager-post-types.php' );
40 include( 'includes/class-wp-job-manager-ajax.php' );
41 include( 'includes/class-wp-job-manager-shortcodes.php' );
42 include( 'includes/class-wp-job-manager-api.php' );
43 include( 'includes/class-wp-job-manager-forms.php' );
44 include( 'includes/class-wp-job-manager-geocode.php' );
45
46 if ( is_admin() ) {
47 include( 'includes/admin/class-wp-job-manager-admin.php' );
48 }
49
50 // Init classes
51 $this->forms = new WP_Job_Manager_Forms();
52 $this->post_types = new WP_Job_Manager_Post_Types();
53
54 // Activation - works with symlinks
55 register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( $this->post_types, 'register_post_types' ), 10 );
56 register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), create_function( "", "include_once( 'includes/class-wp-job-manager-install.php' );" ), 10 );
57 register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), 'flush_rewrite_rules', 15 );
58
59 // Actions
60 add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) );
61 add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 );
62 add_action( 'switch_theme', array( $this->post_types, 'register_post_types' ), 10 );
63 add_action( 'switch_theme', 'flush_rewrite_rules', 15 );
64 add_action( 'widgets_init', create_function( "", "include_once( 'includes/class-wp-job-manager-widgets.php' );" ) );
65 add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
66 add_action( 'admin_init', array( $this, 'updater' ) );
67 }
68
69 /**
70 * Handle Updates
71 */
72 public function updater() {
73 if ( version_compare( JOB_MANAGER_VERSION, get_option( 'wp_job_manager_version' ), '>' ) )
74 include_once( 'includes/class-wp-job-manager-install.php' );
75 }
76
77 /**
78 * Localisation
79 */
80 public function load_plugin_textdomain() {
81 load_plugin_textdomain( 'wp-job-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
82 }
83
84 /**
85 * Load functions
86 */
87 public function include_template_functions() {
88 include( 'wp-job-manager-functions.php' );
89 include( 'wp-job-manager-template.php' );
90 }
91
92 /**
93 * Register and enqueue scripts and css
94 */
95 public function frontend_scripts() {
96 wp_register_script( 'wp-job-manager-ajax-filters', JOB_MANAGER_PLUGIN_URL . '/assets/js/ajax-filters.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
97 wp_register_script( 'wp-job-manager-job-dashboard', JOB_MANAGER_PLUGIN_URL . '/assets/js/job-dashboard.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
98 wp_register_script( 'wp-job-manager-job-application', JOB_MANAGER_PLUGIN_URL . '/assets/js/job-application.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
99 wp_register_script( 'wp-job-manager-job-submission', JOB_MANAGER_PLUGIN_URL . '/assets/js/job-submission.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
100 wp_register_script( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/js/jquery-chosen/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
101 wp_register_script( 'wp-job-manager-term-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/term-multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
102
103 wp_localize_script( 'wp-job-manager-ajax-filters', 'job_manager_ajax_filters', array(
104 'ajax_url' => admin_url('admin-ajax.php')
105 ) );
106 wp_localize_script( 'wp-job-manager-job-dashboard', 'job_manager_job_dashboard', array(
107 'i18n_confirm_delete' => __( 'Are you sure you want to delete this listing?', 'wp-job-manager' )
108 ) );
109
110 wp_enqueue_style( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/css/chosen.css' );
111 wp_enqueue_style( 'wp-job-manager-frontend', JOB_MANAGER_PLUGIN_URL . '/assets/css/frontend.css' );
112 }
113 }
114
115 $GLOBALS['job_manager'] = new WP_Job_Manager();