Skip to:
Content
Pages
Categories
Search
Top
Bottom

Menu link to Profile

Viewing 9 replies - 26 through 34 (of 34 total)

  • Stephen Edgar
    Moderator

    @netweb

    Robin, WordPress includes functions for this:

    e.g. sanitize_file_name($current_user->user_login);

    https://codex.wordpress.org/Function_Reference/sanitize_file_name
    https://codex.wordpress.org/Function_Reference/sanitize_title
    https://codex.wordpress.org/Function_Reference/sanitize_title_with_dashes
    (There are quite a few of them, they are linked in the ‘related’ sections of the above articles)


    Mathijs Lemmers
    Participant

    @mathijs-lemmers


    Robin W
    Moderator

    @robin-w

    @netweb thanks for posting that, thought there would be but couldn’t find it offhand.

    @mathijs-lemmers ok so try

    <meta http-equiv="refresh" content="0;URL=http://mysite.com/forums/users/<?php global $current_user;
          get_currentuserinfo();
    
         echo  sanitize_file_name($current_user->user_login). "";
          
    ?>/edit/">
    
    

    Mathijs Lemmers
    Participant

    @mathijs-lemmers

    Perfect! That did the trick, thanks so much for your time 😉

    Have a nice day everybody!


    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !


    jmodine
    Participant

    @jmodine

    nice thanks


    crzyhrse
    Participant

    @crzyhrse

    Hi Robin,

    This thread is a bit old, but hoping it is still a place to pursue this..

    The WP Exec PHP plugin that was suggested above to enable this has not been updated in over two years, but in trying to use two different current well reviewed plugins that enable placing php in pages via shortcodes, Shortcode Exec PHP and PHP Code For Posts, I get the following same error with your last offered php snippet above…

    Parse error: syntax error, unexpected ‘<‘ in /home/spirawake/public_html/wp-content/plugins/shortcode-exec-php/shortcode-exec-php-class.php(895) : eval()’d code on line 1

    In both cases I created the shortcode using this, as per above;

    <meta http-equiv="refresh" content="0;URL=http://mysite.com/forums/users/<?php global $current_user;
          get_currentuserinfo();
    
         echo  sanitize_file_name($current_user->user_login). "";
          
    ?>/edit/">

    I’ve often used shortcodes in other ways, and am hoping that maybe there is something that needs to be changed in this code because it is being inserted into the page via a shortcode…?

    Kind regards…


    Robin W
    Moderator

    @robin-w

    Try

    https://wordpress.org/plugins/bbp-style-pack/

    go to the logion tab, and you’ll see an option to add a profile link to the menu


    crzyhrse
    Participant

    @crzyhrse

    Thanks Robin,

    It is a very. very nice plugin that you have created… But it won’t do for my needs in these regards… It puts the Edit Profile link into the main menu as a primary menu item, with no ability to change where it is or do anything else with it… It is there in the primary main site menu or nothing…

    If your plugin put the Edit Profile link into the Menu section of Admin, with the same ability to use it however, in the same way that pages, posts, forums, CPTs and all the rest are there to be used as needed or not, then it would be very helpful, even perfect for my needs… Where the link goes TO is perfect…

    I don’t need the rest of what your plugin does, as I have done some very extensive modifications of bbPress via my child theme over the last couple years…

    But anyone starting out or in early stages with bbPress should find your plugin very helpful indeed…

    So, still wondering what you think about getting some code similar to what this thread is discussing to work via one of the PHP plugins I mention above…? I want to be able to just have a discrete but clear little (page/post) link that I can place in a specific place in a specific sidebar, like I have done with other links, that lets logged in folks who are using the forums directly link to their particular Forums profile page and make changes… Basically accomplish the same thing that I can accomplish for the main WP profile page with this link: http://www.yourwebsite.com/wp-admin/profile.php… If someone not logged in clicks this link they are taken to a WP login page…

    Thanks for all the hard work you are doing for a while now to make bbPress better and better and better…

    Kind regards…

Viewing 9 replies - 26 through 34 (of 34 total)
  • You must be logged in to reply to this topic.
Skip to toolbar