WPJM Multi-Company Plugin
AI Plugin

The WPJM Multi-Company plugin (v1.17.1) extends the WPJM Multi-User plugin to support a more complex employer structure where a single keyholder manages multiple subsidiary companies under one organization, each with their own employer user, company profile, and job listings.

Core Features:

At primary employer registration, the plugin silently copies mb_company_id to mb_organization_id on every new employer user. For single-company employers these values are always equal, but for keyholders mb_organization_id becomes the shared identifier across all subsidiary companies within their organization.

The Add Company form allows a keyholder to create subsidiary employer accounts while logged in. Each submission creates a new employer user with their own unique mb_company_id, and an APC feed creates a new company CPT post. The keyholder's mb_organization_id is passed via a hidden field and written to the new employer user, linking them to the same organization. The GF User Registration "Set User as Post Author" setting on this form must remain checked - this is what allows subsidiary employers to see and edit their own company profile via their APC List Block on their dashboard.

On the WPJM job submission form, a dynamic company name dropdown (powered by WPJM Field Editor's _organization_name field) is populated based on who is submitting. Single-company employers see only their own company. Keyholders see all companies in their organization. When a job is submitted, the post_author is transferred to the subsidiary employer selected in the dropdown, with a wp_insert_post_data intercept preventing WPJM's preview/Continue step from overwriting the author assignment.

Keyholders see an organization-scoped job dashboard showing all jobs across their subsidiary companies, with a company filter dropdown to narrow by individual company. All settings including form IDs, field IDs, and meta keys are configurable via a WordPress settings page with no hardcoded values.

Critical Configuration Note:
The mb_organization_id must be read directly from the GF entry field rather than from user meta due to GF's async background processing timing. Additionally, WPJM Field Editor strips leading underscores from meta keys in its field arrays, so _organization_name is referenced as organization_name in hook callbacks.