Support » Plugin: qTranslate X » Bug in qtranxf_excludePages

  • Resolved aliuskon

    (@aliuskon)



    Good day,

    I have just noticed that pages I update after installing qTranslate-X disappear from my menus.

    I believe this happens because I use wp_list_pages function to obtain the list of pages (to be placed in menu) and qtranxf_excludePages function adds the newly updated pages to the exclusion list. qtranxf_excludePages seems to see the newly updated pages as untranslated although they are translated. This happens due to SQL Query not being updated to match new standards introduced by qTranslate-X:
    $query = "SELECT id FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish' AND NOT ($wpdb->posts.post_content LIKE '%<!--:".qtranxf_getLanguage()."-->%')" ;

    As a temporary measure I have fixed it myself:
    $query = "SELECT id FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish' AND NOT ($wpdb->posts.post_content LIKE '%<!--:".qtranxf_getLanguage()."-->%' OR $wpdb->posts.post_content LIKE '%![:".qtranxf_getLanguage()."!]%' ESCAPE '!')" ;
    And it seems to work. Though as I see from the code of qtranxf_excludeUntranslatedPosts function the where clause should be a bit more complex.

    https://wordpress.org/plugins/qtranslate-x/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Bug in qtranxf_excludePages’ is closed to new replies.