Automattic / Automattic/WP-Job-Manager

WP Job Manager - Applications - Job Dashboard Shows Application Forms from All Languages

Open
#2,868 1 comment 0 reactions 0 assignees View on GitHub
Enhancement
Dominant language
PHP
Stars
899
Forks
369
Avg merge
11h 37m
Merged PRs (30d)
12

Description

### Is your feature request related to a problem? Please describe
When using WPML with the Applications add-on of WP Job Manager, the Job Dashboard incorrectly displays application forms from all languages, instead of showing only the forms in the current language. This affects the job edit form and creates confusion for users.

### Describe the solution you'd like

- Open the …/wp-content/plugins/wp-job-manager-applications/includes/wp-job-manager-applications-functions.php file.
- Look for line 302.
- Replace:
```
function get_application_forms() {
$posts = new WP_Query(
array(
'post_type' => 'job_application_form',
'posts_per_page' => - 1,
'suppress_filters' => true,
'orderby' => 'title',
'order' => 'ASC',
)
);

$default_form = WP_Job_Manager_Applications_Default_Form::get_default_form();

if ( $posts->post_count <= 1 ) {
return null;
}
$application_forms = [];

if ( array_key_exists( 'ID', $default_form ) ) {
$application_forms[ $default_form['ID'] ] = $default_form['post_title'];
}

foreach ( $posts->posts as $post ) {
$application_forms[ $post->ID ] = $post->post_title;
}
return apply_filters( 'job_application_forms', $application_forms );
}
```
- With:
```
// WPML Workaround for compsupp-7797
function get_application_forms() {
$posts = new WP_Query(
array(
'post_type' => 'job_application_form',
'posts_per_page' => - 1,
'suppress_filters' => false, // replace true with false
'orderby' => 'title',
'order' => 'ASC',
)
);

$default_form = WP_Job_Manager_Applications_Default_Form::get_default_form();

if ( $posts->post_count < 1 ) { // replace <= with <
return null;
}
$application_forms = [];
/* comment out this part if you don't want to see the default form in other languages
if ( array_key_exists( 'ID', $default_form ) ) {
$application_forms[ $default_form['ID'] ] = $default_form['post_title'];
}*/

foreach ( $posts->posts as $post ) {
$application_forms[ $post->ID ] = $post->post_title;
}
return apply_filters( 'job_application_forms', $application_forms );
}
```

Contributor guide

Open the contributing guide

Research direction

Start in wp-content/plugins/wp-job-manager-applications/includes/wp-job-manager-applications-functions.php at get_application_forms() around line 302. Review how the WP_Query filters application forms and how the default form is added. Done means the Job Dashboard job edit form shows only application forms for the current language when WPML is active, while preserving the intended default-form behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.