This thread is resolved. Here is a description of the problem and solution.
Problem:
You are developing a site using WP Job Manager and WPML and have encountered an issue where the application form in the job edit form displays in all languages instead of only the form of the current language.
Solution:
To resolve this issue, we recommend modifying the code to ensure the application form displays only in the current language. Please follow these steps after making a full site backup:
1) Navigate to the
wp-content/plugins/wp-job-manager-applications/includes/
folder.
2) Open the
wp-job-manager-applications-functions.php
file for editing.
3) Locate line 302.
4) Apply the following changes:
From
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 ); }
To
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 ); }
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please do not hesitate to open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 4 replies, has 0 voices.
Last updated by 5 days, 22 hours ago.
Assisted by: Bigul.