jalbaiges (@jalbaiges)

Forum Replies Created

Viewing 1 replies (of 1 total)

  • jalbaiges
    Participant

    @jalbaiges

    Hello again.

    I have been fighting for a while with the issue and I finally got a solution. I will write it down just in case it could be useful for somebody. Let me say I believe it might exist a smarter solution than mine, so, if you find it, live a comment here, thanks.

    Two steps (bbPress 2.5.3):

    1) In qtranslate/qtranslate_hooks.php, add the following filters:

    add_filter( 'paginate_links', 'qtrans_convertURL' );
    add_filter( 'bbp_get_topic_permalink', 'qtrans_convertURL' );
    add_filter( 'bbp_get_reply_permalink', 'qtrans_convertURL' );
    add_filter( 'bbp_get_forum_permalink', 'qtrans_convertURL' );
    
    add_filter( 'bbp_get_favorites_permalink', 'qtrans_convertURL' );
    add_filter( 'bbp_get_subscriptions_permalink', 'qtrans_convertURL' );
    add_filter( 'bbp_get_user_profile_url', 'qtrans_convertURL' );
    add_filter( 'bbp_get_user_edit_profile_url', 'qtrans_convertURL' );
    add_filter( 'bbp_get_user_replies_created_url', 'qtrans_convertURL' );
    add_filter( 'bbp_get_user_topics_created_url', 'qtrans_convertURL' );

    First four are for the standard navigation inside the forums. Last six are for the user profile menu.

    2) In bbpress/includes/common/template.php, modify a couple of lines in bbp_get_breadcrumb() function:

    In line 2250, replace:

    $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';

    with

    $crumbs[] = '<a href="' . trailingslashit( qtrans_convertURL(home_url()) ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';

    And in line 2267, replace:

    $crumbs[] = '<a href="' . esc_url( $root_url ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';

    with

    $crumbs[] = '<a href="' . esc_url( qtrans_convertURL($root_url) ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';

    That’s all! Hope it serves.

Viewing 1 replies (of 1 total)