[Resolved] Elements hook for WPML

Home Forums Support [Resolved] Elements hook for WPML

Home Forums Support Elements hook for WPML

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #811566
    Stephan

    Hello,
    I have a problem with automatic WPML translations of links to pages in another language.
    In the WPML forum, I found this solution. I should insert into functions.php:

    add_filter( ‘wpml_sl_blacklist_requests’, ‘wpml_sl_blacklist_requests’, 10, 2 );

    function wpml_sl_blacklist_requests( $blacklist, $sitepress ) {
    $blacklist[] = ‘documentation’;
    return $blacklist;
    }

    As far as I understand, the Elements (hooks) are designed for exactly the purpose that we do NOT need to edit the functions.php.
    I tried a bit in Elements (I have already other elements working well) but no success.

    Can you tell me how exactly I can get the above code to work with an element?

    Thanks
    Stephan

    #811666
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    That function can’t be added as a Hook, unfortunately.

    You’d have to add it using one of these methods: https://docs.generatepress.com/article/adding-php/

    #813612
    Stephan

    Hi Tom,
    I did not want to install one more plugin which interferes with the theme. Also, it is not sure that this hook would work.
    For now I found a different solution for this WPML problem, using the direct link by page id. Also, I can’t believe that there is no option in WPML which resolves that, so I asked them in the forum.

    Many thanks for your always quick support!
    Stephan

    #813709
    Tom
    Lead Developer
    Lead Developer

    Glad you found a solution 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.