Edit profile menu button
-
Hello,
We seem to have a simular problem as mentioned in a resolved post, but there was no solution posted (not using it).
Once activating the edit profile the button it shows up in the menu but goes to users/username/edit instead of webpage.com/users/martijn/edit/.Also is it possible to change the text as is possible for the register button or is there a special translate file for this plugin?
Thanks,
Martijn
-
Once activating the edit profile the button it shows up in the menu but goes to users/username/edit instead of webpage.com/users/martijn/edit/.
hmm it goes to then full url on my test site.
can you confirm that you are getting
‘/users/martijn/edit/’ where you are expecting
‘webpage.com/users/martijn/edit/’and that this is not working?
on your second, add this to your functions file
//This function changes the text wherever it is quoted function bsp_change_translate_text( $translated_text ) { if ( $translated_text == 'Register' ) { $translated_text = 'Hello'; } return $translated_text; } add_filter( 'gettext', 'bsp_change_translate_text', 20 );https://codex.bbpress.org/functions-files-and-child-themes-explained/
Yes, when clicking on or hovering over the button it goes to or shows /users/martijn/edit/ where I indeed would expect to go to webpage.com/users/martijn/edit/
I find it very weird since I have a couple of links on my site to other pages on the site that only consist of for example href /contact.
This will go to and show on hover website.com/contactSo even /users/martijn/edit is something I would expect to work on the front, but it doesn’t. after clicking on the button the browser(tested in multiple) is actually trying to go to the url http://users/martijn/edit.
But I think there might be another problem. I just entered the your code our function.php, and I noticed the register button doesn’t go anywere. In the admin panel I put in the complete url to the page containing the bbp register shortcode. I removed the code from the functions.php again to see if that caused it, but it was still happening. Uppon inspecting the element it showed
<a href>register</a>ok, I’ve fixed the register part and both the link and the description should work (I hadn’t spotted that I’d included that in the code, so you don’t need the function above!)
on the edit part – yes I would expect a partial slug to work. Can you tell me what you have exactly in
settings>forums>Forum Root Slug>forum root and whether forum prefix is ticked?
The forum root is forums, and the box is ticket.
Thanks for the update, the register button is working perfectly now.
thanks for that, and great that registration is now working.
I don’t know why the profile edit isn’t working, it may be your theme or another plugin that is affecting.
I’m reluctant to change the core code, as it works for most/all others.
But if you are able to edit/alter php files, then I can work to get a resolution for you. Let me know.
That would be great, I’m able to edit the php files.
ok, so go into
wp-content/plugins/bbp-style-pack/includes/functions.php
You should find line 159 says
$profilelink = '<li><a href="/' .$slug. $user . '/edit">'.$edit_profile.'</a></li>';Can you change this to
$profilelink = '<li><a href="http://www.mysite.com/forums' . $user . '/edit">'.$edit_profile.'</a></li>';obviously changing the http://www.mysite.com part to your website and save.
Then see what the link looks like.
You may need to play with that a bit – eg you might need to omit the http, but if you get it working come back with what you did. If not come back with what you left it at, and what it comes up with.
I’ve got it sort of working:
$profilelink = '<li><a href="http://mysite.com' .$slug. $user . '/edit">'.$edit_profile.'</a></li>';Seems to have fixed the link part, the weird thing is that some get a 404 not found error while the other users have no trouble and get to their bbp profile to edit.
But I think this is a seperate problem, probebly bbpress related.
*Edit: The problem has to do with usernames that have spaces and or a dot for example. The username with the spaces like “user name” will got to mysite.com/users/user%20name/edit after some messing around I got to the profile by changing the url to mysite.com/users/user-name/edit
I don’t know if this comes as part of your plugin or from the bbpress plugin?
Thanks for your help.
I’ve now solved this by making
$user=$current_user->user_nicenameinstead of$user=$current_user->user_loginon line 149 of the previous document.Great – thanks for working that out – that’s the correct solution which I should have put in there, and I’ve changed it in the plugin.
I’ve also added the ability to change the ‘edit profile’ description
Thanks again for your help in improving the plugin.
I’ve updated the plugin and had to change this again:
$profilelink = '<li><a href="http://mysite.com' .$slug. $user . '/edit">'.$edit_profile.'</a></li>';But I made a typo and it send me to http://mysite.com/mysite.com/user….
So now I changed it to
$profilelink = '<li><a href="' .$slug. $user . '/edit">'.$edit_profile.'</a></li>';
instead of
$profilelink = '<li><a href="/' .$slug. $user . '/edit">'.$edit_profile.'</a></li>';To make it work.
Thanks for your help and plugin update.
That is interesting as that doesn’t work on my test site, which needs the ‘/’ to make it work.
This could be theme or other plugin related.
I’ll leave the code as I have it, as that works with the default wordpress/bbpress/wordpress theme combination.
This does mean that you’ll need to keep a note of the change that you have done, as new versions of my plugin may overwrite it.
I figured that, it’s strange it needs it. But Its not a massive change 🙂
Thanks for all your support.
No problem, glad to help and you improved the plugin !
The topic ‘Edit profile menu button’ is closed to new replies.