• Resolved reghyz

    (@reghyz)


    Hello,

    My question is in the title,
    I’ve seen in qtranslate-x admin config page that we can add specific fields references to be parsed by the plugin, but i wanted to know if there could be a way ( maybe with a hook in function.php ) to define fields ( ACF text fields there ) whom the content will not change when switching language.

    ( I’m using the content of this fields to retrieve their posts with a wp_querry using this values in a meta_query array and dont want the qtranslate-x shortcodes to be added to this texts. )

    thanks

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Clause

    (@johnclause)

    Use a version since 3.4 and read https://qtranslatexteam.wordpress.com/integration/

    Does this help?

    Thread Starter reghyz

    (@reghyz)

    no i’ve not found a solution, qtranslate translate all my ACF fields (not only the ones using ACF qtranslate plugin )

    but i’ve just found a way in my code just by adding a part of the brackets of the languages tag and setting the ‘compare’ operator to ‘LIKE’ to my querry :

    $args = array(
        'numberposts'   => -1,
        'post_type'     => 'shared_documents',
        'meta_query' => array(
            array( 'key' => 'my_first_value', 'value'   => ']'.$wanted_valA.'[', 'compare'=>'LIKE' ),
            array( 'key' => 'my_second_value', 'value'   => ']'.$wanted_valB.'[', 'compare'=>'LIKE' )
         ),
    );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to prevent language switching on specific fields ? (using ACF’ is closed to new replies.