탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

In Tutor LMS, the Courses Archive Page is not correctly translated. While the static page can be translated, the translated page is not properly assigned in the backend. This leads to an incorrect URL being generated by the language switcher, pointing to an auto-generated slug instead of the expected URL.

Workaround

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

Part 1

  • Open the …/wp-content/plugins/tutor/classes/Template.php file.
  • Look for line 103.
  • Replace:
    $selected_archive_page = (int) tutor_utils()->get_option( 'course_archive_page' );
    
    if ( $page_id === $selected_archive_page ) {
    
  • With:
    $selected_archive_page = (int) tutor_utils()->get_option( 'course_archive_page' );
    
    // WPML Workaround for compsupp-7650 | Part 1
    $selected_archive_page = apply_filters( 'wpml_object_id', $selected_archive_page, get_post_type($selected_archive_page), true );
    
    if ( $page_id === $selected_archive_page ) {
    

Part 2

  • Open …/wp-content/plugins/tutor/classes/Utils.php file.
  • Replace:
    if ( $course_archive_page && '-1' !== $course_archive_page ) {
    	$course_page_url = get_permalink( $course_archive_page );
    }
    
  • With:
    if ( $course_archive_page && '-1' !== $course_archive_page ) {
    	
    	// WPML Workaround for compsupp-7650 | Part 2
    	$course_archive_page = apply_filters( 'wpml_object_id', $course_archive_page, get_post_type($course_archive_page), true );
    	
    	$course_page_url = get_permalink( $course_archive_page );
    }
    

Part 3

  • Go to WPML > Settings page.
  • Scroll down to the Post Type section.
  • Translate the archive course slug.

답장을 남겨주세요

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

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