Plugin Directory

Changeset 3421484


Ignore:
Timestamp:
12/17/2025 01:59:26 AM (5 weeks ago)
Author:
arothman
Message:

Adjusted the /job/ post type registration to only happen if the sync key is present. This allows plugins like WP Job Manager to coexist with PCRecruiter Extensions in iframe-only mode.

Location:
pcrecruiter-extensions
Files:
33 added
2 edited

Legend:

Unmodified
Added
Removed
  • pcrecruiter-extensions/trunk/PCRecruiter-Extensions.php

    r3421365 r3421484  
    55 * Plugin URI: https://www.pcrecruiter.net
    66 * Description: Integrates PCRecruiter job boards with WordPress via iframe embed or full job sync with /job/ custom post type.
    7  * Version: 2.0.1
     7 * Version: 2.0.2
    88 * Requires at least: 5.6
    99 * Requires PHP: 7.4
     
    167167register_deactivation_hook(__FILE__, 'pcrecruiter_deactivate_job_manager_plugin');
    168168// Hook to initialize the custom post type
    169 add_action('init', ['PCR_Job_Manager', 'register_job_post_type']);
     169add_action('init', 'pcrecruiter_conditional_register_job_post_type');
     170
     171function pcrecruiter_conditional_register_job_post_type() {
     172    $options = get_option('pcrecruiter_feed_options', array());
     173    $has_jobboard_key = !empty($options['jobboard_security_key']);
     174   
     175    // Only register job post type if full sync is enabled
     176    if ($has_jobboard_key) {
     177        PCR_Job_Manager::register_job_post_type();
     178    }
     179}
    170180
    171181// Add columns to admin area
     
    13661376
    13671377        if (isset($input['jobboard_security_key'])) {
    1368             $new_input['jobboard_security_key'] = sanitize_text_field($input['jobboard_security_key']);
    1369         }
    1370 
     1378            $old_key = $existing_options['jobboard_security_key'] ?? '';
     1379            $new_key = sanitize_text_field($input['jobboard_security_key']);
     1380            $new_input['jobboard_security_key'] = $new_key;
     1381           
     1382            // If security key changed (added, removed, or modified), flush rewrite rules
     1383            // to ensure /job/ URLs work correctly (or stop working when disabled)
     1384            if ($old_key !== $new_key) {
     1385                if (!empty($new_key)) {
     1386                    // Key added/changed: register post type then flush
     1387                    PCR_Job_Manager::register_job_post_type();
     1388                } else {
     1389                    // Key removed: unregister post type
     1390                    PCR_Job_Manager::unregister_job_post_type();
     1391                }
     1392                flush_rewrite_rules();
     1393            }
     1394        }
    13711395        if (isset($input['job_404_page'])) {
    13721396            $new_input['job_404_page'] = sanitize_text_field($input['job_404_page']);
  • pcrecruiter-extensions/trunk/readme.txt

    r3421369 r3421484  
    11=== PCRecruiter Extensions ===
    2 Contributors: arothman, mstdev
     2Contributors: Main Sequence Technology, Inc.
    33Tags: recruiting, staffing, applicant tracking, job board, job posting
    44Requires at least: 5.6
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.0.1
     7Stable tag: 2.0.2
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3333Also: PCRecruiter job XML/JSON feed downloading for integrations or imports.
    3434
    35 Full documentation: [https://learning.pcrecruiter.net/site/docs/wordpress/](https://learning.pcrecruiter.net/site/docs/wordpress/)
     35Full documentation:
     36<a href="https://learning.pcrecruiter.net/site/docs/wordpress/">https://learning.pcrecruiter.net/site/docs/wordpress/</a>
    3637
    3738Support:
     
    4041== Installation ==
    4142
    42 1. Upload the plugin ZIP via Plugins -> Add New -> Upload Plugin, or install from WordPress.org
     431. Upload the plugin ZIP via Plugins → Add New → Upload Plugin, or install from WordPress.org
    43442. Activate the plugin.
    4445
     
    56571. Create a page and add:
    5758   [PCRecruiter link="jobmanager"]
    58 2. Go to Settings -> PCRecruiter Extensions -> Job Board Sync.
     592. Go to Settings → PCRecruiter Extensions → Job Board Sync.
    59603. Generate a Sync Token and enter it into the PCR “WordPress Sync Settings” panel.
    6061
     
    112113
    113114= Can I customize how job titles display in browser tabs? =
    114 Yes, with the full-sync you may configure this in Settings -> PCRecruiter Extensions -> Job Title Format.
     115Yes, with the full-sync you may configure this in Settings → PCRecruiter Extensions → Job Title Format.
    115116
    116117= Does the plugin work with Google Jobs? =
     
    118119
    119120= Where can I find the full setup guide? =
    120 All documentation is online at [https://learning.pcrecruiter.net/site/docs/wordpress/](https://learning.pcrecruiter.net/site/docs/wordpress/)
     121All documentation is online at:
     122<a href="https://learning.pcrecruiter.net/site/docs/wordpress/">https://learning.pcrecruiter.net/site/docs/wordpress/</a>
    121123
    122124== Changelog ==
     125= 2.0.2 - 2024-16-10 =
     126* Accomodate other /job/ plugins in iframe-only mode
    123127
    124128= 2.0.1 - 2024-16-10 =
Note: See TracChangeset for help on using the changeset viewer.