gabrielstuff (@gabrielstuff)

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @gabrielstuff

    Participant

    Well, this hack (https://bbpress.trac.wordpress.org/ticket/1478#comment:7) correct the 404 error :
    `
    function fix_bbp_404() {
    global $wp_query;

    if ( $wp_query->bbp_is_single_user ||
    $wp_query->bbp_is_single_user_edit ||
    $wp_query->bbp_is_view
    ) {
    $wp_query->is_404 = false;
    // Unset nocache_headers
    foreach( wp_get_nocache_headers() as $name => $field_value ) {
    @header( “{$name}: ” );
    }
    // Set status 200
    status_header( 200 );
    }
    }
    add_action( ‘wp’, ‘fix_bbp_404’ );
    `

    I tried the trunk version but didn’t get any result… Hack above fix the issue… even if it return wrong title.

    @gabrielstuff

    Participant

    Fixed !

    The core wordpress was doing some security check that break the redirect ! it works perfectly.

    @gabrielstuff

    Participant

    Hey there, please find my little code that I’ve put into function.php :

    function ela_signup_redirect($redirect_to){
      $return_url = "";
    
    if (defined('ICL_LANGUAGE_CODE')) {
        switch (ICL_LANGUAGE_CODE) {
            case 'fr':
                $return_url = "http://xxx/merci/";
              break;
            case 'en':
                  $return_url = "http://xxx/forum/sinscrire/";
              break;
            default:
                  $return_url = 'langue non configurée';
              break;
        }
    }
    error_log("message : " . $return_url);
    return $return_url;
    }
    add_filter("bbp_user_register_redirect_to", "ela_signup_redirect");
    

    I’ve been trying to debug everywhere and hunt when the redirect happen, but I still get redirected to the admin panel.

    Any help would be appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)