Reply To: Conflict with qTranslate
Hello,
Thanks for the answer! In fact, this is no a display problem in admin menu, but rights (user capabilities). When I set the URL “edit.php?post_type=forum” directly in the addresses’ bar, WordPress says to me I have not the right to access this page.
After a “very” long debug, I found why this behavior appends. The qTranslate plugin is loaded before bbPress and sets up the WP_User via the function wp_get_current_user() and so sets its allcaps. So when WordPress object is init in wp-settings.php file to sets up current user, wp_get_current_user() returns the existing user and not reloads capabilities.
I fixed this problem in adding a param to wp_get_current_user():
function wp_get_current_user($new_user = false){}
and the same param to get_currentuserinfo() and wp_set_current_user(). I also modified the condition in get_currentuserinfo():
if ( ! empty( $current_user ) && $new_user === false ) {
and the condition in wp_set_current_user():
if ( isset( $current_user ) && ( $current_user instanceof WP_User ) && ( $id == $current_user->ID ) && $new_user === false )
Then I added the true value in param to the call of wp_get_current_user() in init method of WP class.
Maybe this bug appears because I installed qTranslate before bbPress. Maybe this bug not appears if bbPress is installed before qTranslate. I’ll try an another install to test that. It would be nice not to change the core of WordPress.