탐색 건너뛰기

Waiting for author

Topic Tags: Compatibility

Overview of the issue

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.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • 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 );
    }
    

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>